CSS: Hide the TR or the TD?
When the page is displayed on the monitor I want to have one header. When the page is printed I want to replace that with a simple logo. I've used display: none before. The way the page is laid out I can have two rows, one with the first header and one with the logo. Should I attach display: none to the TR or to the TD? (Yes I know, use a div. But work with me on this one.)
Re: CSS: Hide the TR or the TD?
Use a DIV. I've seen Firefox do very weird things if you apply display:none to any table sub-elements.
Re: CSS: Hide the TR or the TD?
Weird cool or weird OMG? Either way, this looks like the perfect excuse to stop supporting those few clients who are still using Win95 and IE4 (seriously) and get them to upgrade to IE5. Thanks CornedBee.
Re: CSS: Hide the TR or the TD?
If it is a header then you should use a header tag, possibly H1 :) Because, well, it is a header. You can style H1 just like you can style a DIV; only difference is that H1 describes better what is the content actually in question. DIV and SPAN are general purpose, to be used when you can't use anything else.
Re: CSS: Hide the TR or the TD?
Quote:
Originally Posted by VBCasey
Weird cool or weird OMG?
Weird as in it removes the content, but the space is still taken up. Show the row and it will be below its old place, hide it and that space, too, is blank and unused. In other words, the more often you repeat, the more space is taken up.
Re: CSS: Hide the TR or the TD?
Corned Bee: that doesn't always happen. Although I've seen that effect with Opera, not Firefox. But probably a different rendering bug, done differently. My tactic was just to move rows out of the screen with position : absolute; :)