spitableCell

新建apitableCell

类表示表单

方法论

名称 描述性
添加Columns

向当前表添加新列

添加元素

添加段或表或块Lvl内容控件

添加Rows

向当前表添加新行

清除

清除当前单元格内容

GetClassType系统

返回ApitableCell类类型

GetContent

返回当前单元格内容

GetIndex

返回当前单元格索引

GetNext

返回下一个单元格

获取ParentRow

返回当前单元格父行

获取父表

返回当前单元格父表

获取前置

返回前一单元格

获取RowIndex

返回父行索引

删除Column

删除列内当前单元格

删除Row

删除含有当前单元格的行

搜索

查找表单对象范围搜索结果集合Apirange对象

SetBackgroundColor

设置当前表单表色

SetCellBorderBottom

设置边框显示在当前表单元格底部

SetCellBorderLeft

设置边框显示当前表单元格左侧

SetCellBorderRight

设置边框显示当前表单元格右侧

SetCellBorderTop

设置边框显示在当前表单元格顶部

SetCellMarginBottom

指定数位空间,在单元格内容底部范围与表内特定表单元格边框间保留

SetCellMarginLeft

指定数位空间,在单元格内容左侧范围与表内特定表单元格边框间保留

SetCellMarginRight

指定数位空间,在单元格内容右侧范围与表内特定表单元格边框间保留

SetCellMarginTop

指定在表内单元格内上层和表边框间留空

secellPr

设置当前单元格属性

SetColumnBackgroundColor

设置内含当前单元格列中所有单元格的背景色

设号Wrap

指定当前表单显示文档时如何显示父表本设置只影响单元格行为ApiTablePr#SetTableLayout表布局设置使用高超性算法

Setshd

指定灰色应用表单元格内容

SetTextDirection

指定此表单元格文本流方向

SetTextPr

文本设置应用到当前单元格全部内容

SetVerticalAlign

指定当前表单单元格内文本内容垂直对齐

设屏

设置当前表单首选宽度

拆分

拆分单元格数行列

ToJSON系统

转换ApitableCellPr对象为JSON对象

实例

拷贝代码
builder.CreateFile("docx")!varoDocuments=api.GetDocumentvar表Style=ODocument.CreateStyleoTableStyle.SetBasedOn(oDocument.GetStyle("Bordered"))!varo表 = api.Criate表oTable.SetWidth("percent", 100)!varoCell =otable.GetCell(0,0)oCell.AddColumns2假OCell.AddRows2假Var oParentRow =OCell.GetParentRowoParentRow.SetHeight("atLeast", 1440)!var oParent表=oCell.GetParent表Parent表.Set表边界BottomoCell.SetVerticalAlign("top")!varodents=oCell.GetContentsoParagraph.AddText("Align top")!OCell =OTACLOOGETROOGGETELLEoCell.SetVerticalAlign("center")!oParagraph = oCell.GetContent().GetElement(0)!oParagraph.AddText("Align center")!OCell =OTable.GetRow(0)GetCell(2)oCell.SetVerticalAlign("bottom")!oParagraph = oCell.GetContent().GetElement(0)!oParagraph.AddText("Align bottom")!oTable.SetStyle(oTableStyle)!varoNextCell=otable.GetCell(0,1)oNextCell.GetContent().GetElement(0).SetBold(true)!varopreviceCell =otable.GetCell(0,1)oPreviousCell.GetContent().GetElement(0).SetBold(true)!OCell=OTel.GetRow0GetCell0OCell.SetCellFrontBottomOCell.SetCellFrontleleftOCell.SetCellFrontRight(single3205151OCell.SetCellFrontTop(single3205151oTable.GetCell(1, 0).GetContent().GetElement(0).AddText("Cell index: " + oTable.GetCell(1, 0).GetIndex())!oDocument.Push(oTable)!var slassType=ocell.GetClassTypeodeptements =ODocument.GetE元素0odstext (slass类型=+ssstype)builder.SaveFile("docx", "ApiTableCell.docx")!builder.CloseFile();

结果文档