跳到主要内容

CreateTable

Creates a table.

Syntax

expression.CreateTable(nCols, nRows);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nColsRequiredNumber of columns.
nRowsRequiredNumber of rows.

Returns

ApiTable

Example

How to create new table with two rows and four columns.

// Add a table to the pdf document.

const doc = Api.GetDocument();
const page = doc.GetPage(0);
const table = Api.CreateTable(2, 4);
page.AddObject(table);