[jQuery] help with button that hides some <tr> elements in a table
Hi,
I want to make some groups of <tr> tags collapsable, and the button
should be in another <tr> which of course doesn't have to collapse. To
explain it better heres and example code:
<table>
<tr>
<td class="catdiv"><a href="#">Hide/Show</a></td>
</tr>
<tr>
<td>Stuff</td>
</tr>
<tr>
<td>Stuff</td>
</tr>
<tr>
<td class="catdiv"><a href="#">Hide/Show</a></td>
</tr>
<tr>
<td>Stuff</td>
</tr>
<tr>
<td>Stuff</td>
</tr>
<tr>
<td class="catdiv"><a href="#">Hide/Show</a></td>
</tr>
<tr>
<td>Stuff</td>
</tr>
<tr>
<td>Stuff</td>
</tr>
</table>
In this case i'd like each button link to hide the <tr> elements that
are between that button and the next one.
This is for a forum in which im trying to implement a button for users
to be able to collapse forum categories.
Is there any fast way of getting jQuery to hide those <TR>?
Thanks!