How to get the height of the first two <tr> in a table using jQuery?
I need to display only the first two rows in table
, and when I click on the div I need to animate it slideDown
and show the full table. I could just set display
in none
for all the rows of the table except the first two, but this will ruin the effect when I want to show them all ... so instead I decided to use overflow:hidden
and set the height to div based on the height of the first two rows of the table. Any ideas how to do this?
Structure:
<div>
<table>
<tr>
<td>data</td>
</tr>
<tr>
<td>data</td>
</tr>
<tr>
<td>data</td>
</tr>
<tr>
<td>data</td>
</tr>
<tr>
<td>data</td>
</tr>
</table>
</div>
+3
3 answers