Hi,
I’m trying to upgrade from Aspose.Words 15.7 to the latest version.
I have issues creating/modifying tables with non-align columns.
A simplified repro is the following :
I need to create a table with the following exact cell widths, cell merges and table preferred width:
Document d = new Document();
Table t = new Table(d);
d.getFirstSection().getBody().appendChild(t);
Row r = new Row(d);
t.appendChild®;
Cell c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.9));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.9));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.95));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(81.35));
r.appendChild©;
c.getCellFormat().setVerticalMerge(CellMerge.FIRST);
r = new Row(d);
t.appendChild®;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.9));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.9));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.95));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(81.35));
r.appendChild©;
c.getCellFormat().setVerticalMerge(CellMerge.PREVIOUS);
r = new Row(d);
t.appendChild®;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.9));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.9));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(123.95));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(81.35));
r.appendChild©;
c.getCellFormat().setVerticalMerge(CellMerge.PREVIOUS);
r = new Row(d);
t.appendChild®;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(107.75));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(264.0));
r.appendChild©;
c = new Cell(d);
c.getCellFormat().setPreferredWidth(PreferredWidth.fromPoints(81.35));
r.appendChild©;
t.setAllowAutoFit(true);
t.setPreferredWidth(PreferredWidth.fromPoints(300));
My issue is that I hand up with a odd looking table.
I didn’t use a document builder on purpose since my issues are more with processing existing tables.
How can I create a normal looking table with these exact dimensions?
Thank you very much.
Best regards,
David