跳到主要内容

CreateTable

Creates a new table with a specified number of rows and columns.

Syntax

expression.CreateTable(cols, rows);

expression - A variable that represents a Api class.

Parameters

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

Returns

ApiTable

Example

This example creates a 3x3 table and inserts it into the document.

let doc = Api.GetDocument();
let table = Api.CreateTable(3, 3);
doc.Push(table);
table.SetWidth("percent", 100);