• Post category:API
  • Запись изменена:09.05.2023

CreateTable(nCols, nRows) → { ApiTable }

Создает новую таблицу с указанным количеством строк и столбцов.

Параметры:

НазваниеТипОписание
nColsчисленныйЧисло столбцов.
nRowsчисленныйКоличество строк.

Возвращает:

Тип ApiTable

Пример

builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTable = Api.CreateTable(3, 3);
oDocument.Push(oTable);
oTable.SetTableBorderTop("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderBottom("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderLeft("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderRight("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderInsideV("single", 32, 0, 255, 111, 61);
oTable.SetTableBorderInsideH("single", 32, 0, 255, 111, 61);
oTable.SetWidth("percent", 100);
builder.SaveFile("docx", "CreateTable.docx");
builder.CloseFile();