Excel not parsing HTML properly - nested table

H

hiren.hp

Hi,

I am trying to have excel open an HTML file that contains nested
table, the outer table contains fields that can be used to perform the
sort. But this is not working, Excel instead converts "Line 1" and
"Zipcode 1" into merged cells as well as "Line 2" and "Zipcode 2" (see
below). If I open this HTML in browser and use Javascript function
to sort the table it works fine.

Sample HTML that has issues:
---------------------------
<HTML>
<Table>
<TR>
<TD>Line 1 </TD>
<TD>Zipcode 1</TD>
<TD><table>
<tr bgcolor=yellow> <td> House 1</td><td>phone #</td></
tr>
<tr bgcolor=green> <td> House 2</td><td>phone #</td></
tr>
</table></TD>
</TR>
<TR>
<TD>Line 2 </TD>
<TD>Zipcode 2</TD>
<TD><table>
<tr bgcolor=green> <td> House 5</td><td>phone #</td></
tr>
<tr bgcolor=yellow> <td> House 6</td><td>phone #</td></
tr>
<tr bgcolor=red> <td> House 7</td><td>phone #</td></tr>
</table></TD>
</TR>
</HTML>

----------------------

Basically I want to create a list that I can use to sort on first
column (Line item) or second column (Zipcode). I would prefer not to
convert the inner table into <PRE> as this works, but the results look
awful.

Thanks in advance,
Hiren
 
H

hiren.hp

Peo,

I tried it, it gives me the same results. If you copy and paste the
HTML from my original post and open it in browser, you will see that
there are only two rows.
If you then open the HTML file in MS Excel you will see Excel convert
these cells into Merged Cells with 4 rows.

So the question is what changes can I make in my HTML so that Excel
will not merge the cells. I would like the end result to be displayed
as follows:

LineItem Zip Data
Line 1 Zip1 Multiple formatted lines

Regards,
Hiren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top