In order to expose one particular TBODY with cross-browser support, I need to split my <table>
to 3 tables on the fly and expose the middle one. Is it possible without rebuilding a whole table? Anyone knows relevant tutorials that could help to make it efficiently?
Example. Initially:
<table>
<tbody>
<tr><td></td></tr>
....
</tbody>
<tbody>
<tr><td></td></tr>
....
</tbody>
<tbody>
<tr><td></td></tr>
....
</tbody>
</table>
Result:
<table>
<tbody>
<tr><td></td></tr>
....
</tbody>
</table>
<table>
<tbody>
<tr><td></td></tr>
开发者_如何学C ....
</tbody>
</table>
<table>
<tbody>
<tr><td></td></tr>
....
</tbody>
</table>
Not sure this is what you are after, but you could to the following with jQuery.
$('tbody').hide();
$('tbody:odd').show();
http://jsfiddle.net/jasongennaro/NybeH/
This hides all the tbody
elements and then shows only the odd ones. Fyi... odd works here because it's a zero-based count.
精彩评论