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

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ā€¦???

<P>First Table to fit in Word.</P>
<P>
    <TABLE style="WIDTH: 777px" cellSpacing=0 cellPadding=0 background=/clcm25Wap/D:\Canarys\Projects\cLCM2.5\clcm25Wap\clcm25Wap\images\{AC913BE6-C069-4D4E-BAF6-DDE565CF0765}\2596120186-12lulla-090918.jpg border=1>
        <TBODY>
            <TR>
                <TD rowSpan=2>&nbsp;dfdsfsdfsdfsdfsdfsd<BR>&nbsp;i hate u</TD>
                <TD>&nbsp;sdfsdfsdfsdfdsdfsdfd</TD>
                <TD>sdfsdfdsfsdfsdfsdfsd&nbsp;</TD>
                <TD>sdfsdfsdfsdfsdeeeeeeeeeeeeeeee&nbsp;</TD>
                <TD>&nbsp;55555555555555555555555555555555555555555555</TD>
                <TD>&nbsp;fffffffffffffffffffffffffffffffffffffffffffffffffffffff</TD>
            </TR>
            <TR>
                <TD>&nbsp;blank data</TD>
                <TD>&nbsp;</TD>
                <TD>&nbsp;</TD>
                <TD>&nbsp;</TD>
                <TD>&nbsp;no data by srimadhav</TD>
            </TR>
        </TBODY>
    </TABLE>
</P>

Thanks,

Hi

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,

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,