|
Hello everybody,
I'm having some problems changing the style.
Changing it from "table-cell" to "hidden" is no problem, but the other way around doesn't seem to work.
Here's a bit of code:
<head>
<script language="JavaScript">
function showCell() {
document.getElementById('cellName').style.visibility='table-cell';
}
</script>
<style type="text/css">
#cellName {visibility:hidden; }
</style>
</head><body>
<table border="1" id="myTable">
<tr><td height="50">text<td></td></td></tr>
<tr><td>text</td><td id="cellName">This should appear but is doesn't</td></tr>
</table>
<a href="#" onclick="showCell()">link</a>
|
|
|
Hey buddy.. First off i noticed no closing body or html tags.. but i'm sure that's just because it's a code snippet :-P
The Fixed: use visibility="visible"
works in firefox/mozilla and IE (and should be okay in NS4)
<head>
<script language="JavaScript">
function showCell() {
document.getElementById('cellName').style.visibility='visible';
}
</script>
<style type="text/css">
#cellName {visibility:hidden; }
</style>
</head><body>
<table border="1" id="myTable">
<tr><td height="50">text<td></td></td></tr>
<tr><td>text</td><td id="cellName">This will appear when the below link is clicked</td></tr>
</table>
<a href="#" onclick="showCell()">link</a>
</body>
</html>
<Added>
note: when using javascript (rather than a stylesheet) to change visibility,
NS4 is the "readheaded stepchild"
see here: http://www.webreference.com/js/column18/visibility.html
|
|
|
Hi DougMelvin, thanks for your reply.
i'll give it a try.
Cheers,
pieter
|
|
|
Hi DougMelvin, thanks for your reply.
i'll give it a try.
Cheers,
pieter
<Added>
sorry for double reply: guess i was to impatient
|
|
|
|
|
|
|
|