Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding a table after the fact.

Status
Not open for further replies.

ghostinzman

Vendor
Mar 21, 2005
87
US
Okay, I made a page using a table that was 750px wide and had 5 rows. I centered it, so it displays in the center of the browser. One thing I have now noticed is there is a lot of white space on each side if you are viewing it in a high resolution screen since it is setup for 800x600. Can I insert another table before this one in the body of the HTML document, set it's width to 100%, set a background color, so that this background will display on higher resolution monitors? I tried doing it in Dreamweaver under the code view, but it didn't work. Is it even possible to do it this way, or will I need to start over?
 
Why not just put the background color to the body? It is much less complicated.
 
I thought of that after I posted this. But I think I am missing a step or maybe not understanding. The background color of my table I want to remain white. The background color of my page outside my table i want to be a light gray. Is there a simple way to tell a browser to display anything outside the table as a light gray, or did I limit that by setting my table attribute to 750 pixels? I mean, I have a 750 pixel page centered. When viewed from a high res monitor, say 1280 by 1024, you have over 250 pixels of blank space on each side. I need to keep the original table the size of 750 pixels due to some formatting and layout items I have done.
 
Code:
<body style="background: #ccc;">
 <table style="background: white;">
  ...
 </table>
</body>
I cannot see why you can't use it like this.
 
That was it!

I actually went

<body style="background-color: #33A02C">
<table style="background-color: "FFFFFF">
...
</table>
</body>

when I was typing in the code, dreamweaver came up with a popup menu for certain selections. It is probably the same thing as you recommended. There would have been no way I would have gotten that without your help. Thanks.

another quick question. If I want to make sure my table displays at the top of the page, is it align="top"?
 
No. If you have the code you are showing, table will be at the top always. Since it is the first element of the body, and the default vertical alignment is top. If you have no margins or padding, it should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top