Setting the fit behaviour of HTML table to Word

Hi,


I am creating an HTML table and inserting it to a Word document (.DOCX) using following APIs:

DocumnentBuilder.moveToBookmark(BookmarkName);
DocumnentBuilder.insertHtml(HtmlStr);

But the table does not appear (fit) properly on the document. I have attached the output document and the HTML file of the table.

I tried to use the following APIs also to set the auto-fit behavior of the table but had no luck:

Table table = (Table)Document.getChild(NodeType.TABLE, 0, true);
table.autoFit(AutoFitBehavior.AUTO_FIT_TO_WINDOW);

I get the same table.

Please suggest some solution for the table to appear correctly on the document.

Thanks & Regards,
Prabhaker Kr

Hi Prabhaker,


Thanks for your inquiry. Please upgrade to the latest version 15.8.0 from following link:
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

In case the problem still remains, please attach your input Word document here for testing. We will investigate the issue further on our end and provide you more information.

Best regards,

Hi Awais,


I have updated the Aspose word to the latest version. I still get the same problem as explained in the attached document with the initial post.

Kindly test it and help with some solution.

Regards,
Prabhaker Kr

Hi Prabhaker,


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document
  • Your expected document which shows the correct output. Please create this document using Microsoft Word application.
  • Please create a simple Java application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start further investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,