Skip to main content

AddRows

Adds the new rows to the current table.

Syntax​

expression.AddRows(nCount, isBefore);

expression - A variable that represents an ApiTableCell class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
nCountRequiredNumberCount of rows to be added.
isBeforeOptionalbooleanfalseSpecifies if the new rows will be added before or after the current cell.

Returns​

ApiTable | null

Example​

Add new rows to a table via one of its cells in a PDF.

// Insert rows right after a specific cell in a PDF table.

// Add two rows after the first cell in a PDF.

const doc = Api.GetDocument();
const page = doc.GetPage(0);

const table = Api.CreateTable(2, 3);
const cell = table.GetRow(0).GetCell(0);
const paragraph = Api.CreateParagraph();
paragraph.AddText('Two new rows added after this cell.');
cell.GetContent().Push(paragraph);
cell.AddRows(2, false);

page.AddObject(table);