max width of a table

Post Reply
Posts: 193
Joined: Thu Mar 04, 2010 9:19 pm

max width of a table

Post by mister_v »


The content of my HTML-pages are always in table,
because it is easy to place the content, the menu and other stuff.

I used to set the width of the table to 100% so the entire page is filled.
This was ok for screens of 1024x768 and 1280x960.
But it doesn't look so good on 1600x900 and bigger screens.

Isn't there a way you can set the max size and that it is still scalable.
I don't want a fix width, for smaller screen.

Site Admin
Posts: 198
Joined: Mon Jul 21, 2008 9:52 am

Re: max width of a table

Post by chris »

you can use max-width in css.

for example you can use the following class:

Code: Select all

.bigtable{max-width:1024px;valign:top;margin-left: auto;margin-right: auto}
max-width:1024px : The maximum size of your table will be 1024 pixels.
valign:top : position of the table
margin-left: auto;margin-right: auto : it centers you table in the middle of the page
Post Reply