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.
Not sure how to fix this