CreateTable

function CreateTable(nCols: number = null, nRows: number = null): ApiTable

Description

Creates a new table with a specified number of rows and columns.

Parameters

nColsnumberdefault: null

Number of columns.

nRowsnumberdefault: null

Number of rows.

Returns

ApiTable

Try It

var oDocument = Api.GetDocument();
var oTable = Api.CreateTable(3, 3);
oDocument.Push(oTable);
oTable.SetWidth("percent", 100);

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