Page 1 of 1

TableGrid/TableCol width calculation wrong

PostPosted: Sun May 17, 2020 2:48 am
by kalrap
Hi Jason,

I am trying to convert xhtml into docx using Docx4j. Its very simple html : -

Code: Select all
<body><p>Hi {!checkingthis},</p><p> </p><p>Welcome</p><p> </p><table style=\"width:200px\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\" ><tbody><tr><td colspan=\"1\" rowspan=\"1\">{!testtesttesttesttesttesttesttesttesttest}</td><td colspan=\"1\" rowspan=\"1\">{!testtesttesttesttesttesttesttesttesttest}</td><td colspan=\"1\" rowspan=\"1\">{!a}</td><td colspan=\"1\" rowspan=\"1\">{!testtesttesttesttesttesttesttesttesttesttesttesttesttest}</td></tr><tr><td colspan=\"1\" rowspan=\"1\"> </td><td colspan=\"1\" rowspan=\"1\"> </td><td colspan=\"1\" rowspan=\"1\"> </td><td colspan=\"1\" rowspan=\"1\">{!SUM(ABOVE)}</td></tr></tbody></table><p> </p></body>


Issue is with tablecol width or table grid(coz it takes table col) width. I commented following line in XHTMLImporterImpl : // tableHelper.setupTblGrid( tableBox, tbl, tableProperties);


And it works then.

Screenshot from 2020-05-16 21-08-11.png
WrongTable
Screenshot from 2020-05-16 21-08-11.png (155.45 KiB) Viewed 1073 times


Screenshot from 2020-05-16 21-08-24.png
Screenshot from 2020-05-16 21-08-24.png (167.06 KiB) Viewed 1073 times



Not sure how to fix this

Re: TableGrid/TableCol width calculation wrong

PostPosted: Wed May 27, 2020 3:52 am
by kalrap
@jason Any update on this ?