跳到主要内容

SetTextDirection

指定当前表格单元格的文本流动方向。

语法

expression.SetTextDirection(sType);

expression - 表示 ApiTableCell 类的变量。

参数

名称必需/可选数据类型默认值描述
sType必需TextFlowDirection文本流动方向的类型。

返回值

boolean

示例

如何设置表格单元格的文本方向。

// Create a table and set the text direction for the ApiTableCell object.

const doc = Api.GetDocument();
const page = doc.GetPage(0);

const table = Api.CreateTable(2, 4);
const row = table.GetRow(0);
row.SetHeight(30 * 36000);
const cell = row.GetCell(0);
cell.SetTextDirection("tbrl");
const content = cell.GetContent();
const paragraph = Api.CreateParagraph();
paragraph.AddText("This is just a sample text.");
content.Push(paragraph);

page.AddObject(table);