I have a table like this, all rows have the structure like 1st data row
<table id='table1'>
<thead>
<tr>...table headers...</tr>
</thead>
<tr>
<td>xyz</td>
<td>
<table><tr></tr></table>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
...
...
</table>
All those inside tables have some texts and images.
Initially, I use
$('#table1').find("tr:gt(0)").hide();
to hide everything except header
Now I want to select say from row 1 to row 15 and unhide them. From another post, I know I can use
$('#table1').children('tr').slice(1,15) to find those rows, but when I want to show them using
$('#table1').children('tr').slice(1,15).show(1000);
all those inside tables are still not showing, but the text “xyz” is showed Am I missing something here?
The
trare not.childrenof table, but descendants because they are inside an implicitly createdtbodyelement. Try with.children()of thetbodyhttp://jsfiddle.net/utmXa/4/