跳到主要内容

SetHeight

设置当前表格的总高度,并将其平均分配给各表格行。该值作为每行的最小高度应用,因此如果行内容需要更多空间,行可以更高。

语法​

expression.SetHeight(nValue);

expression - 表示 ApiTable 类的变量。

参数​

名称必需/可选数据类型默认值描述
nValue必需EMU以英制度量单位表示的表格高度。

返回值​

EMU | null

示例​

设置文档中表格的总高度。

// Distribute the requested height proportionally among the table rows.

// Create a table and set its overall height to 60 millimeters.

let doc = Api.GetDocument();
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
doc.Push(table);
table.SetHeight(Api.MillimetersToEmus(60));