The nitty-gritty:
This requires prototype, but is easily adjusted for any "ExplandorCollapse" JavaScript function.
Give table tags with ids for each group, then hide/show that id. It so simple you wish you had thought about it yourself!
[code]
<table>
<tbody>
<tr>
<th colspan="3" onmousedown="$('group1').toggle();">Group 1</th>
</tr>
</tbody>
<tbody id="group1">
<tr><td>row1 col1 </td><td>row1 col2 </td><td>row1 col2 </td></tr>
<tr><td>row 2 col1 </td><td>row 2 col2 </td><td>row 2 col3 </td></tr>
</tbody>
<tbody>
<tr><th onmousedown="$('group2').toggle();">Group 2</th></tr>
</tbody>
<tbody id="group2">
<tr><td>col1 </td><td>col2 </td><td>row 1 col3 </td></tr>
<tr><td>row 2 col1 </td><td>row 2 col2 </td><td>row 2 col3 </td></tr>
</tbody>
</table>
[/code]
check it out here:
http://thefivepillars.org/hideshow.html
Abonner på:
Legg inn kommentarer (Atom)

Ingen kommentarer:
Legg inn en kommentar