Get Started
Usage API
More information

Split

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

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

Parameters:

Name Type Default Description
nRow Number 1

Count of rows which the cell will be split.

nCol Number 1

Count of columns which the cell will be split.

Returns:

Type
ApiTable | null

Example

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

Resulting document