Merges an array of cells. If the merge is done successfully, it will return the resulting merged cell, otherwise the result will be "null".
Name | Type | Description |
aCells | Array.<ApiTableCell> | The array of cells to be merged. |
builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table"); oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered")); var oTable = Api.CreateTable(5, 5); oTable.SetWidth("percent", 100); oTable.SetStyle(oTableStyle); var oCell = oTable.MergeCells([oTable.GetRow(1).GetCell(1), oTable.GetRow(1).GetCell(2), oTable.GetRow(2).GetCell(1), oTable.GetRow(2).GetCell(2)]); oCell.GetContent().GetElement(0).AddText("Merged cell"); oDocument.Push(oTable); builder.SaveFile("docx", "MergeCells.docx"); builder.CloseFile();