跳到主要内容

GetTableDescription

返回表格说明。

语法

expression.GetTableDescription();

expression - 表示 ApiTablePr 类的变量。

参数

此方法没有任何参数。

返回值

string

示例

此示例展示如何获取表格说明。

// How to get the table description and display it in the document.

// Add text showing the description of the table.

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);