Results 1 to 6 of 6

Thread: CSS: Hide the TR or the TD?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    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.)

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    15

    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.

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    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.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    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;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width