We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Table cells merge

For an existing table inside a Word template, the cells merge mechanism becomes complete useless as the setHorizontalMerge commands mess up all the cells widths in the other rows, and the cells to be merged are not merged. The cells set as setHorizontalMerge PREVIOUS are in fact deleted, not merged. What is the reason for this?

Hi Jan,


Thanks for your inquiry. By Microsoft Word design, rows in a table in a Microsoft Word document are completely independent. It means each row can have any number of cells of any width. So if you imagine first row with one wide cell and second row with two narrow cells, then looking at this document the cell in the first row will appear horizontally merged. But it is not a merged cell; it is just a single wide cell. Another perfectly valid scenario is when the first row has two cells. First cell has CellMerge.First and second cell has CellMerge.Previous, in this case it is a merged cell. In both cases, the visual appearance in MS Word is exactly the same. Both cases are valid. Please check following articles for more details:

Working with Merged Cells

Best regards,