跳到主要内容

MoveToPrevCell

将光标移动到上一个表格单元格。

语法​

expression.MoveToPrevCell(count);

expression - 表示 ApiDocument 类的变量。

参数​

名称必需/可选数据类型默认值描述
count可选number1要移动经过的单元格数。

返回值​

boolean

示例​

将光标移动到文档中表格的上一个单元格。

// Navigate between adjacent table cells without selecting a cell directly.

// Add text at the cursor position after moving back to the previous cell in a document.

let doc = Api.GetDocument();
let table = Api.CreateTable(3, 3);
doc.InsertContent([table]);
let cell = table.Cells[0][2];
cell.GetContent().GetRange(0, 0).MoveCursorToPos(0);
doc.MoveToPrevCell();
doc.EnterText("Prev cell");