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

Free Support Forum - aspose.com

Horizontall & Vertically Merged Cells representation question

Hey all,


I read in the documentation that merged cells may be represented in one of two ways… Sometimes they may be exposed as a single cell and in other cases it might be two cells where the second cell has a special property CellFormat.*Merge value set…

See: http://www.aspose.com/docs/display/wordsjava/Working+with+Merged+Cells

Sometimes when you load an existing document cells in a table will appear merged. However these can be in fact one long cell. Microsoft Word at times is known to export merged cells in this way. This can cause confusion when attempting to work with individual cells. There appears to be no particular pattern as to when this happens.

Does this statement apply to both vertically and horizontally merged cells? I.e. Can vertically merged cells come through as a single cell (I’ve only seen multiple cell representation in this case). For the horizontal case, I generally see that horizontally merged cells get represented as a single cell. On the other hand, using a different application (Open Office), I was able to create a table where the horizontally merged cells were represented as two cells in the DOM.

Is it possible for me to enforce a single view… I.e. can I force Aspose to always represented horizontally merged cells as a single cell? On the other hand, can I ensure that vertically merged cells are represented as multiple cells?

Thank you with any help on determining this. It would be very helpful for me to enforce the representation.

Also, in the case of the multiple cells per split, do I get the full width of the cell from the first cellFormat.getWidth() or do I need to sum up the width from both (or multiple cells)?


Hi Chase,

Thanks for your inquiry. Please note that a table in MS Word is a set of independent rows. Each row has a set
of cells independent on cells of other rows. So there is no logical
“column” in a MS Word’s table. “The 1st column” is something like “a set
of the 1st cells of each row in a table”.

For example, it’s possible to have a table where the 1st row consists
of two cells: 2cm and 1cm and the 2nd row consists of different two
cells: 1cm and 2cm of width.

I suggest you please read the following documentation link about cell width calculations.
http://www.aspose.com/docs/display/wordsjava/Specifying+Table+and+Cell+Widths