跳到主要内容

CreateTable

创建表格。

语法

expression.CreateTable(rows, cols);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
rows必需number行数。
cols必需number列数。

返回值

ApiTable

示例

在 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);