User:HaLo2FrEeEk/Sandbox/Collapse.js

$('table.collapsible').each(function(e) { $t = $(this);  $th = $t.find('th');  $th.append("[-] ");  });

$('.collapseLink > a').click(function(e) { e.preventDefault;  collapseTable($(this));  });

collapseTable = function (e) { $t = e.closest('table'); $elems = $t.find('td').parent; if($t.hasClass('collapsed')) { $elems.show('fast'); $t.removeClass('collapsed'); e.html('-'); } else { $elems.hide('fast'); $t.addClass('collapsed'); e.html('+'); } }