跳到主要内容

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.

// Creates a table, adds it to the document, and sets its width to 100%.

// How to create the ApiTable object and add it to the ApiDocument class.

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