By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,447 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,447 IT Pros & Developers. It's quick & easy.

Table Max-Width

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Mike wrote:
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.
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/
Jul 20 '05 #2

P: n/a
> 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.
Jul 20 '05 #3

P: n/a
> 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:
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
Jul 20 '05 #4

P: n/a
In article David Dorward wrote:
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
|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.

Jul 20 '05 #5

P: n/a
> 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.
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.

Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.