Display:none problem with IE
Posted: Sun Jan 02, 2005 4:13 am
Hi guys.
I have a <table> that has some of it's <tr> element displays set to "display:none". The reason I'm doing this is so I can show/hide the <tr> elements depending on the state of a checkbox.
I'm applying the style to the <tr> elements using CSS and changing the "display" value using JavaScript. This is working fine with Netscape and Firefox but IE doesn't seem to be able to access the "display" value once the "display" has been set to "none".
Here's a quick example:
Does anyone know of a way to get this working?
Cheers.
Si ++
I have a <table> that has some of it's <tr> element displays set to "display:none". The reason I'm doing this is so I can show/hide the <tr> elements depending on the state of a checkbox.
I'm applying the style to the <tr> elements using CSS and changing the "display" value using JavaScript. This is working fine with Netscape and Firefox but IE doesn't seem to be able to access the "display" value once the "display" has been set to "none".
Here's a quick example:
Code: Select all
<html>
<head>
<script type="text/javascript">
function flip()
{
document.getElementById("foobar").style.display = "table-row";
}
</script>
<style type="text/css">
tr.optional {
display:none;
}
</style>
</head>
<body>
<table>
<tr><td>Hello</td></tr>
<tr class="optional" id="foobar"><td>World</td></tr>
</table>
<a href="javascript:flip()">Show TR</a>
</body>
</html>Cheers.
Si ++