SetTableDescription
设置表格说明。
语法
expression.SetTableDescription(sDescr);
expression - 表示 ApiTablePr 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| sDescr | 必需 | string | 要设置的表格说明。 |
返回值
boolean
示例
此示例设置表格说明。
// How to display the table description in the document.
// Get the table description from the table properties.
let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let tablePr = tableStyle.GetTablePr();
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
tablePr.SetTableDescription("Empty table");
table.SetStyle(tableStyle);
let paragraph = doc.GetElement(0);
paragraph.AddText("Table description: " + tablePr.GetTableDescription());
doc.Push(table);