*Andy Fish* <ajfish (AT) blueyonder (DOT) co.uk>:
Quote:
I am trying to show/hide a group of table rows using javascript and CSS. |
The correct CSS way would be "visibility: collapse":
<http://www.w3.org/TR/CSS2/tables.html#dynamic-effects>. I've never tried
that and doubt it's well supported, though.
Quote:
my_tbody_element.style.display="none";
my_tbody_element.style.display="block"; |
IMO the best way of the JS part is a dynamically assigned class, not
'.style'. That's true for almost any JS-CSS interaction, a.k.a. "DHTML".
See <http://webdesign.crissov.de/Scripting/modifyClass.js> for some basic
functions/methods for that.
Quote:
This works in IE but doesn't work in css-compliant browsers, because
these use "table-row-group" instead |
tbody.show {display: block; display: table-row-group;}
tbody.hide {display: none;}
Switch¹ between those classes (if the aforementioned method indeed does
not work). It /should/ work and is at least better than JS browser filters.
--
"Music is essentially useless, as life is."
George Santayana