Jump to content

Table with variable up to a maximum width?


Bule

Recommended Posts

Permit me a small gripe. The W3Schools CSS tutorial or reference (http://www.w3schools...fault.asp#table) for table properties doesn't seem to show which attributes one can specify for a table - nowhere on the site can I find a good link. What I want to do is to create a table that will not be wider than a certain amount. For instance, if the browser window is less than 800 pixels, the table spans the entire width of the window. On larger windows, the table remains at a maximum of 800 pixels. This seems to work in Firefox but not in Chrome. (Have not tested IE.)

table{width:100%;max-width:800px;}

I tried adding a

display:block;

attribute (saw that somewhere on the net, but no success. Is there a way to make a table vary its width up to a certain maximum?

Edited by Bule
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...