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

Free Support Forum - aspose.com

Adjust tables width

Hi,

some of the tables in my word document are goes out of the page by inserting big tables through InsertHTML() method, could you please suggest me how to adjust the tables to fit in word window using Aspose.Words

PFA for my sample document where table was exceded out of the page.

Thanks,

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Could you please attach you HTML here for testing? I will check the problem on my side and provide you more information.

Best regards,

Hi Andrey,

Thanks for your response, here is my HTML string to insert into document, here what i found was table width was 777px, Is this the problem? if so, is there any work arround to fit the tables into word window page…???


First Table to fit in Word.

















 dfdsfsdfsdfsdfsdfsd
 i hate u
 sdfsdfsdfsdfdsdfsdfd sdfsdfdsfsdfsdfsdfsd  sdfsdfsdfsdfsdeeeeeeeeeeeeeeee   55555555555555555555555555555555555555555555  fffffffffffffffffffffffffffffffffffffffffffffffffffffff
 blank data        no data by srimadhav


Thanks,

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Yes, you are right, one of the reasons of the problem is the fixed width of the table. As a workaround, you can specify width of the table in percents.

<TABLE style="WIDTH: 100%"

Another reason is that there are long strings without white spaces in table cells. MS Word cannot wrap such strings and that is why your table is expanded outside page. I suppose, in real life you do not have such strings in your tables.

Best regards,

Hi Andrey,

Thanks for your response. this sample table was created by one of our customers toshow us how the tables are look like in word. actually this table was created using RadEditors, when i am getting this html string from data base, the width was 777px, different users put their own width, So how should i manage this width while inserting html string into document or after inserting how should i fit into word window, Is there any properties/methods to do this?

Thanks,

Hi Srinu,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think, you can specify width of the HTML table before inserting. For example, you can try using regular expressions to achieve this.

Best regards,