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 slideDownand show the full table. I could just set displayin nonefor 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:hiddenand 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