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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

min-width max-width 1

Status
Not open for further replies.

jacktripper

Programmer
Dec 5, 2001
124
US

I've tried unsuccessfully to find some answers to this, although I'm sure people have done this before.

I want to have a min and max size to my web page. Right now I want the Min to be about 950px wide and the max at 1200px. I set up my stylesheet as:

table.main
{
background-color: White;
min-width: 950px;
max-width: 1200px;
width: auto;
border: 1;
border-style: dashed;
}

My table row is basically a column with a logo (fixed size), and a column with a menu that I want to expand as high as the 1200px max of the table. I have that colunm set to 100%.

But, I guess because of that, the whole table expands to 100% regardless of having the stylesheet set to a max-width of 1200 px.

What am I missing here? I just want to make sure my page/table never gets smaller than 950 and never gets bigger that 1200.

I am using IE 7.

 
1st: If you have such stringent rules about the width, why not just set a definite width. 350px of working space doesn't seem to be enough to warrant all the issues you will be having with changing the width.
2nd: I do believe it is the nature of tables to behave like that. Table will, provided that it cannot fit the contents into the specified width, expand to fit the contents. If you design your elements with divs (it also sounds that would be more appropriate, since it doesn't seem like you're dealing with tabular data), you will avoid these issues.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
i dnt think some browsers render those attributes well.....i recommend fixed width....or u can use javascript to adjust these settings based on user resolutions
 
I will experiment with DIVs instead and see how it works.

the 350px is mostly just made up. Its the theory that I'm concerned about. Ultimatley I'd like to set-up a website that truely has a min and max width and it actually works.

It just seems those particular settings are ambiguous.

Maybe DIVs will behave differently for what I am attempting.
 
Well, that was easy!

Works just like I want it to using DIVs instead of tables.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top