跳到主要内容

CreateTable

创建表格。

语法

expression.CreateTable(nCols, nRows);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
nCols必需列数。
nRows必需行数。

返回值

ApiTable

示例

此示例创建 2x4 表格并将其插入演示文稿。

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

// Add a table to the presentation.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
const table = Api.CreateTable(2, 4);
slide.RemoveAllObjects();
slide.AddObject(table);