AddRows

function AddRows(nCount: Number = null, isBefore: boolean = false): ApiTable | "null"

Description

Adds the new rows to the current table.

Parameters

nCountNumberdefault: null

Count of rows to be added.

isBeforebooleandefault: false

Specifies if the rows will be added before or after the current row.

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.SetStyle(oTableStyle);
var oRow = oTable.GetRow(0);
oRow.GetCell(0).GetContent().GetElement(0).AddText("Second row");
oTable.SetWidth("percent", 100);
oRow.AddRows(1, true);
oDocument.Push(oTable);

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