100% table from edge to edge

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • torweb
    New Member
    • Jan 2008
    • 14

    100% table from edge to edge

    I'd like to have a table at the top of my screen that's filled with a color, which will reach from end to end of the monitor, regardless of screen resolution. I'm guessing this is simple...maybe not. Setting it to 100% doesn't seem to do the trick...

    Thanks in advance for any pointers.
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    Height unfortunately won't work.

    Originally posted by drhowarddrfine
    Height does not work correctly in IE. IE treats height as 'min-height'. And, as you might expect, min-height doesn't work at all in IE.
    But if you wan't something with width you could try this:

    [HTML] <head>
    <style type="text/css">
    #box {
    width:100%;
    background-color:#000;
    }
    </style>
    </head>

    <body>

    <div id="box">
    </div>

    </body>

    [/HTML]

    If this isn't wide enough you could change it to this:

    [CODE=css] <style type="text/css">
    * {
    width:100%;
    }
    #box {
    width:100%;
    background-color:#000;
    }
    </style>
    [/CODE]

    Hope it helps, Thanks, Death

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      Death's first solution is correct but you don't need the div. Just apply all that to the table. But if you are trying to get the table from edge to edge, you need to get rid of the default margins, so:
      [code=css]
      html,body,table {margin:0}[/code]

      Comment

      • torweb
        New Member
        • Jan 2008
        • 14

        #4
        Thanks drhowarddrfine and Death...both worked great. I love learning this stuff!

        Comment

        Working...