Skip to main content

CreateTable

Creates a table.

Syntax

expression.CreateTable(rows, cols);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
rowsRequirednumberNumber of rows.
colsRequirednumberNumber of columns.

Returns

ApiTable

Example

Insert a table with multiple rows and columns in a PDF.

// How do I add a table to a PDF page?

// Create and place a table with specific dimensions in a PDF.

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