I'm trying to dynamically change the visibility of a table row. I can
hide the row, but I'm having trouble making it visible again. This is
what I have:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test</title>
<script type="text/javascript">
function ready() {
var elem=document.getElementById( "tr" );
elem.style.display='none';
elem.style.display='table-row';
}
</script></head>
<body onload="ready()">
<table>
<tr id="tr">
<td>Hello, world!</td>
</tr></table></body></html>
Setting display to "none" works fine, but trying to set it back to
"table-row" (which is what it defaults to, right?) doesn't work (IE
and Firefox both say "invalid argument"). Does the following quote
from the W3C specification mean I can't do this?
"User agents may ignore these 'display' property values for HTML
documents, since authors should not alter an element's expected
behavior." [WRT table-related display property values]
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.