SetCellBorderLeft
设置将显示在当前表格单元格左侧的边框。
继承自 ApiTableCellPr.SetCellBorderLeft。
语法
expression.SetCellBorderLeft(type, size, space, color);
expression - 表示 ApiTableCell 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| type | 必需 | BorderType | 单元格左侧边框样式。 | |
| size | 必需 | pt_8 | 当前单元格左侧边框的宽度,以点的八分之一为单位。 | |
| space | 必需 | pt | 表格单元格左侧用于放置此边框的间距偏移量,以磅为单位。 | |
| color | 必需 | ApiColor | 边框颜色。 |
返回值
boolean
示例
在文档中沿表格单元格左边缘添加边框。
// How do I draw a line on the left side of a table cell in a document?
// Give a cell a visible left border to separate it from the column beside it in a document.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("We create a 3x3 table and add the left 4 point black border to cell #1:");
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
let cell = table.GetRow(0).GetCell(0);
cell.SetCellBorderLeft("single", 32, 0, Api.Color(51, 51, 51));
table.SetStyle(tableStyle);
doc.Push(table);