跳到主要内容

GetNext

返回下一个单元格(如果存在)。

语法

expression.GetNext();

expression - 表示 ApiTableCell 类的变量。

参数

此方法没有任何参数。

返回值

ApiTableCell | null

示例

此示例展示如何获取下一个单元格。

// How to get next cell.

// Retrieve the cell from the table and get the next one.

let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
table.SetStyle(tableStyle);
table.GetCell(0, 0).GetContent().GetElement(0).AddText("Cell 1");
table.GetCell(0, 1).GetContent().GetElement(0).AddText("Cell 2");
doc.Push(table);
let nextCell = table.GetCell(0, 0).GetNext();
nextCell.GetContent().GetElement(0).SetBold(true);