weide wrote:
> I use asp.net's DataGrid to show data. And I want to use as
> http://icant.co.uk/csstablegallery/index.php .
>
> So I need to change like this:
>
> <table id = "DataGridResult">
> <tr><td>Name</td><td>Age</td></tr>
> <tr><td>1</td><td>2</td><tr>
> <tr><td>1</td><td>2</td><tr>
> </table>
>
> <table id = "DataGridResult">
> <thead>
> <tr><td>Name</td><td>Age</td></tr>
> </thead>
> <tbody>
> <tr><td>1</td><td>2</td><tr>
> <tr class="odd"><td>1</td><td>2</td><tr>
> </tbody>
> </table>
>
> The code is like this:
> $("table#DataGridResult").children().find('tr:eq(0)').wrap("<thead></thead>");
>
> but in firefox the result is this:
> <table id = "DataGridResult">
> <tbody>
> <thead>
> <tr><td>Name</td><td>Age</td></tr>
> </thead>
> <tr><td>1</td><td>2</td><tr>
> <tr><td>1</td><td>2</td><tr>
> </tbody>
> </table>
>
> :(
>
>   

Firefox places the tbody in when one is not specified, I think its an 
XHTML thing where tbody is an implied element that you don't have to 
write in. Why are you using javascript to create this output? If its 
just for the look of it tack a class name onto the first tr or better 
yet see if you can modify the asp to write it out how you want. 
Alternatively you could try using an HTML 4.01 doctype though I can't 
remember if firefox still puts the tbody in or not.

HTH,
Rob

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to