跳到主要内容

SetRowPr

为当前表格行设置属性。

语法​

expression.SetRowPr(oApiTableRowPr);

expression - 表示 ApiTableRow 类的变量。

参数​

名称必需/可选数据类型默认值描述
oApiTableRowPr必需ApiTableRowPr表格行属性。

返回值​

boolean

示例​

设置文档中表格行的格式属性。

// SetRowPr applies an ApiTableRowPr object to configure row appearance such as height.

// Create a table, build row properties with a fixed minimum height, and apply them to the first row in a document.

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);
doc.Push(table);
let row = table.GetRow(0);
let rowPr = Api.CreateTableRowPr();
rowPr.SetHeight("atLeast", 720);
row.SetRowPr(rowPr);