跳到主要内容

SetTableDescription

设置表格说明。

继承自 ApiTablePr.SetTableDescription。

语法​

expression.SetTableDescription(sDescr);

expression - 表示 ApiTable 类的变量。

参数​

名称必需/可选数据类型默认值描述
sDescr必需string要设置的表格说明。

返回值​

boolean

示例​

在文档中为表格附加纯文本描述。

// How do I store a written summary alongside a table in a document?

// Provide accessible alternative text for a table 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.SetTableDescription("Empty table");
table.SetStyle(tableStyle);
let paragraph = doc.GetElement(0);
paragraph.AddText("Table description: " + table.GetTableDescription());
doc.Push(table);