Split

Split([oCell], [nRow], [nCol]) → { ApiTable | null }

Splits the cell into a given number of rows and columns.

Parameters:

Name Type Default Description
oCell ApiTableCell null

The cell which will be split.

nRow Number 1

Count of rows into which the cell will be split.

nCol Number 1

Count of columns into which the cell will be split.

Returns:

Type
ApiTable | null

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered"));
var oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
var oCell = oTable.GetCell(0, 0);
oTable.Split(oCell, 2, 2);
builder.SaveFile("docx", "Split.docx");
builder.CloseFile();

Resulting document