Get Started
Documentation

AddRows

AddRows(nCount, [isBefore]) → { ApiTable | null }

Add a new rows to the current table.

Parameters:

Name Type Default Description
nCount Number

count of rows to be added.

isBefore boolean false

Add a new rows before or after the row.

Returns:

Type
ApiTable | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oTable = Api.CreateTable(3, 3);
oRow = oTable.GetRow(0);
oRow.GetCell(0).GetContent().GetElement(0).AddText("Second row");
oTable.SetWidth("percent", 100);
oRow.AddRows(1, true);
oDocument.Push(oTable);
builder.SaveFile("docx", "AddRows.docx");
builder.CloseFile();