- Code: Select all
<html>
<body>
<table width=\"100%\">
<tr>
<td width=\"33%\">aaa</td>
<td width=\"33%\">aaa</td>
<td width=\"33%\">aaa</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
ad here is how i convert it:
- Code: Select all
XHTMLImporterImpl XHTMLImporter = new XHTMLImporterImpl(docxOut);
XHTMLImporter.setParagraphFormatting(FormattingOption.CLASS_PLUS_OTHER);
XHTMLImporter.setRunFormatting(FormattingOption.CLASS_PLUS_OTHER);
XHTMLImporter.setTableFormatting(FormattingOption.IGNORE_CLASS);
XHTMLImporter.setHyperlinkStyle("Hyperlink");
final List<Object> parsedHtml = XHTMLImporter.convert(htmlString, null);
docxOut.getMainDocumentPart().getContent().addAll(parsedHtml);
unfortunatelly in a result docx table is oversized and 3rd column is barely visible (you can see it in attachment). Is there a way to fix this?