GetTextPr
返回将应用于表格中符合条件格式类型的所有文本块的文本属性集。
语法
expression.GetTextPr();
expression - 表示 ApiTableStylePr 类的变量。
参数
此方法没有任何参数。
返回值
示例
检索文档中应用于表格样式条件区域的文本格式。
// How do I read the text styling assigned to a specific part of a table style in a document?
// Access the text appearance settings for a targeted section of a styled table in a document.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("We create a 3x3 table and set the bold font weight to the text in cell #1:");
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
let tableStylePr = tableStyle.GetConditionalTableStyle("topLeftCell");
table.SetTableLook(true, true, true, true, true, true);
tableStylePr.GetTextPr().SetBold(true);
paragraph = table.GetRow(0).GetCell(0).GetContent().GetElement(0);
paragraph.AddText("Bold text");
paragraph = table.GetRow(0).GetCell(1).GetContent().GetElement(0);
paragraph.AddText("Normal text");
table.SetStyle(tableStyle);
doc.Push(table);