By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

100% table from edge to edge

P: 14
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.
Jan 30 '08 #1
Share this Question
Share on Google+
3 Replies


Death Slaught
100+
P: 1,137
Height unfortunately won't work.

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:

Expand|Select|Wrap|Line Numbers
  1.  <style type="text/css"> 
  2.   * {
  3.     width:100%;
  4.   }
  5.   #box {
  6.     width:100%;
  7.     background-color:#000;
  8.   }
  9. </style>
  10.  
Hope it helps, Thanks, Death
Jan 30 '08 #2

drhowarddrfine
Expert 5K+
P: 7,435
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:
Expand|Select|Wrap|Line Numbers
  1. html,body,table{margin:0}
Jan 30 '08 #3

P: 14
Thanks drhowarddrfine and Death...both worked great. I love learning this stuff!
Jan 31 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.