HighDots Forums  

Table Max-Width

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Table Max-Width in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Table Max-Width - 11-02-2003 , 11:59 PM






Hi guys,

For some reason, max-width isn't working on my computer. It's probably
a minor syntax error on my part, but I just want to be sure.

I'm running IE 6.0.2800.1106 SP1, my resolution is set to 1152x864,
and the browser is maximized. In an external CSS file, I have:

table { max-width: 1024px }

In the HTML, I have:

<table cellpadding="5" width="100%">


The file is being called correctly, since all of my other CSS is
working properly, but when I look at the page in my higher resolution,
it's still at 100%. Am I missing something?

TIA,

Mike

Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: Table Max-Width - 11-03-2003 , 01:36 AM






Mike wrote:

Quote:
For some reason, max-width isn't working on my computer. It's probably
a minor syntax error on my part, but I just want to be sure.

I'm running IE 6.0.2800.1106 SP1,
Internet Explorer doesn't support max-width.

Quote:
table { max-width: 1024px }
table cellpadding="5" width="100%"
What are browsers suppose to do when the specified width and the max-width
conflict?

--
David Dorward http://dorward.me.uk/


Reply With Quote
  #3  
Old   
Graham J
 
Posts: n/a

Default Re: Table Max-Width - 11-03-2003 , 03:34 AM



Quote:
The file is being called correctly, since all of my other CSS is
working properly, but when I look at the page in my higher
resolution,
it's still at 100%. Am I missing something?
-ish.

The min- and max- width and heights don't work in Internet Explorer.
Check in something like Opera or Mozilla Firebird and you could find
you have done your bit ok.

Andrew Clover has a JavaScript
(http://www.doxdesk.com/software/js/minmax.html) to fudge around this
transparently for IE5+ on Windows which may help, depending on your
particular requirements.




Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: Table Max-Width - 11-03-2003 , 09:50 AM



Quote:
The min- and max- width and heights don't work in Internet Explorer.
Check in something like Opera or Mozilla Firebird and you could find
you have done your bit ok.

Andrew Clover has a JavaScript
(http://www.doxdesk.com/software/js/minmax.html) to fudge around this
transparently for IE5+ on Windows which may help, depending on your
particular requirements.

Thanks a lot, Graham, I'm checking that out now. Didn't realize that
it didn't work with IE, I though that 6.0 was supposed to support it.

David had asked:

Quote:
What are browsers suppose to do when the specified width and the max-width
conflict?


My thought there was that it would be at 100% unless the visitors
resolution was set higher than 1024x768, at which point it would be
set at 1024. Was this not right? I've never actually seen it work,
being an IE user, so I don't know if I've created errors or what.

Thanks again,

Mike


Reply With Quote
  #5  
Old   
Lauri Raittila
 
Posts: n/a

Default Re: Table Max-Width - 11-03-2003 , 01:14 PM



In article David Dorward wrote:
Quote:
Mike wrote:

For some reason, max-width isn't working on my computer. It's probably

Internet Explorer doesn't support max-width.

table { max-width: 1024px }
table cellpadding="5" width="100%"

What are browsers suppose to do when the specified width and the max-width
conflict?
There can't be conflict:
http://www.w3.org/TR/CSS2/visudet.html#min-max-widths
http://www.w3.org/TR/CSS21/visudet.html#min-max-widths
Quote:
Applies to: all elements except non-replaced inline elements and
table elements
^^^^^

(but IIRC, Opera implements max-width on table as if it would be
container width, and tries to fit table in that space, if that is
possible. Makes sence...)

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.



Reply With Quote
  #6  
Old   
Graham J
 
Posts: n/a

Default Re: Table Max-Width - 11-03-2003 , 02:37 PM



Quote:
Thanks a lot, Graham, I'm checking that out now. Didn't realize that
it didn't work with IE, I though that 6.0 was supposed to support
it.

I only knew because I was caught out with min-width not so long ago.
I'd definitely recommend getting another browser to give you a second
opinion on your pages as otherwise you may be writing pages that only
work because of IE bugs or only fail because of IE bugs. Not that IE
has a monopoly on bugs.

Quote:
My thought there was that it would be at 100% unless the visitors
resolution was set higher than 1024x768, at which point it would be
set at 1024. Was this not right?
Yes, but said with a bit of hand waving and a slight gritting of
teeth.

That is to say you do of course have to allow for the actual size of
the browser windows and any borders and scroll bars they may have, and
then consider the web page itself and if you have any margin or
padding on the body element (there may be some by default) and of
course any width, padding or margin on any other element that the
table would be inside. There may also be issues with the size of the
table cells if they are not consistent with the table size which means
something has to give. However yes there should be a point at which
the table width will be set at 1024 and not get any wider.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.