Forum Moderators: open
table#appears {
border:1px solid #CCFF00;
visibility:hidden;
} The table starts out hidden, but the border is still visible. If I subsequently show and hide the table using javascript, the borders disappear. I.e. this (also simplified) works.
function hideTable() {
document.getElementById('appears').style.visibility="visible"
document.getElementById('appears').style.visibility="hidden"
} I have found this to be true in IE5.0, IE5.5, IE6 and NN7. Has anyone had to deal with this before?
The only workaround I can come up with is to make the table background a different color than the cells. Then using cell spacing, I can adjust the width of these pseudo-borders. That is not a very attractive solution, but it seems to work.
Owner edit - Oh, and with no borders, visibility:hidden works just as expected.
Corrected Syntax
It also appears that the visibility behavior of not hiding the borders may not be altogether incorrect either (at least from the CSS point of view). visibility is only supposed to effect blocks. Without studying the DOM and CSS defintitions closely, I'm guessing that the border may not technically be part of the block - rather it surrounds a block, so it may not be affected by changing the visibility attribute. Funny the js works, though.
It looks like I'm stuck using a less attractive (but not all that bad) workaround.
Thanks korkus2000 and BobFisk for your suggestions.