Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Apr 22, 2016 1:18 am

When i insert a html string into a paragraph ,but an error occur that shows outofrangeexception.Following is the code:
Paragraph para = new Paragraph();
para.appendHTML(htmlText);

the htmlText's content is :
string html = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">"+
"<col width=\"100\">" +
"<col width=\"100\">" +
"<tr><td rowspan=\"2\" align=\"left\">100</td><td>200</td><td>300</td></tr>"+
"<tr><td>500</td><td>600</td></tr>"+
"</table>";

if excluding the two col line ,it works well ,

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Fri Apr 22, 2016 6:55 am

Hi,

Thanks for your posting.
Please close <col> tag as <col width=\"100\"/>.
Code: Select all
       string htmlcode = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">" +
             "<col width=\"100\"/>" +
             "<col width=\"100\"/>" +
             "<tr><td rowspan=\"2\" align=\"left\">100</td><td>200</td><td>300</td></tr>" +
             "<tr><td>500</td><td>600</td></tr>" +
             "</table>";


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Apr 26, 2016 8:43 am

Hi,

Has your issue been resolved?
Thanks for your feedback in advance.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc