Reputation: 3185
I am using
HTMLWorker.ParseToList(New StringReader(HTMLCode), New StyleSheet)
On a String HTMLCode that contains :
<html>
<body>
<table width="auto;">
<tr style="color:white ; background: #336699; font-style:bold;">
<th width="257px;" height="40" >Service Name</th>
<th width="100px;" height="40">Hits </th>
<th width="100px;" height="40">Revenue</th>
<th width="100px;" height="40">Service Cost</th>
</tr>
<tr>
<td width="257px;" height="30" > GtalkDay </td>
<td width="257px;" height="30" > 320 </td>
<td width="257px;" height="30" > 67.20 </td>
<td width="257px;" height="30" > (0.21 K) </td>
</tr>
<tr style="background: #EBEBE0">
<td width="257px;" height="30" > TwitterDay </td>
<td width="257px;" height="30" > 885 </td>
<td width="257px;" height="30" > 185.85 </td>
<td width="257px;" height="30" > (0.21 K) </td>
</tr>
<tr>
<td width="257px;" height="30" > YahooDay </td>
<td width="257px;" height="30" > 626 </td>
<td width="257px;" height="30" > 131.46 </td>
<td width="257px;" height="30" > (0.21 K) </td>
</tr>
</table>
</body>
</html>
And it is returning the error:
Input string was not in a correct format.
What could be the problem? the HTML code looks perfectly fine.
all Help would be appreciated
PS: I tried to remove Width and Height and Background attributes and the Parsing worked fine
Upvotes: 0
Views: 2673
Reputation: 3962
This might be due to the not proper format of your HTML.
you should remove spaces before the closing tags of you HTML tags as shown below:
Make change of this,
<td width="257px;" height="30" > GtalkDay </td>
to
<td width="257px;" height="30">GtalkDay</td>
Upvotes: 2