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

Free Support Forum - aspose.com

Merged Cells are Lost after Inserting HTML into Document using .NET

I am facing problem while inserting HTML table contains merged cells into word document, the table inserted but I lost the merging and cells divided again, this issue appearing while using aspose-words-20.11-jdk16.jar version, but this case working fine with aspose-words-15.9.0-jdk16.jar version, here is my JAVA Code and value of HTML should be inserted

DocumentBuilder builder = new DocumentBuilder(doc);
String val = "<div align=\"right\"><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" dir=\"rtl\"><tbody><tr><td colspan=\"2\" valign=\"top\" width=\"623\"> <p dir=\"RTL\">1</p></td><td valign=\"top\" width=\"312\"><p dir=\"RTL\">2</p></td></tr><tr><td valign=\"top\" width=\"312\"> <p dir=\"RTL\">3</p></td><td valign=\"top\" width=\"312\"><p dir=\"RTL\">3</p> </td><td valign=\"top\" width=\"312\"><p dir=\"RTL\">4</p></td></tr></tbody></table></div>";

correct.PNG (13.4 KB)
wrong.PNG (8.4 KB)

2 posts were split to a new topic: Problem with Merged Cell after inserting HTML into document


We have tested the scenario using the latest version of Aspose.Words for Java 21.6 and have not found the shared issue. So, please use Aspose.Words for Java 21.6. We have attached the output DOCX with this post for your kind reference.
21.6.docx (7.5 KB)