Split

function Split(oCell: ApiTableCell = null, nRow: Number = 1, nCol: Number = 1): ApiTable | "null"

Description

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

Parameters

oCellApiTableCelldefault: null

The cell which will be split.

nRowNumberdefault: 1

Count of rows into which the cell will be split.

nColNumberdefault: 1

Count of columns into which the cell will be split.

Returns

ApiTable | "null"

Try It

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);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).