After experimenting some more I have come up with some code that seems
to work in most browsers:

.content {
    width:        100%;
    max-width:    960px;
    min-width:    640px;
    margin-left:  auto;
    margin-right: auto;
}

This can be applied to a body or div tag with an embedded table and
will center the element with a minimum width of 640px and a maximum
with of 960px while expanding to 100% of the available viewport within
the given bounds -- but it does not work for Internet Explorer.

I have tried:

.content {
    width:        100%;
    max-width:    960px;
    min-width:    640px;
    margin-left:  auto;
    margin-right: auto;
    width: expression(this.width > 960 ? 960 : this.width < 640 ? 640 : true);
}

As recommended by others, but that does not seem to work.  Any
suggestions as to how to make this work in Internet Explorer without
some drastic hacks, etc.?

Thanks,
Jack


On Mon, Mar 23, 2009 at 10:26 AM, Gunlaug Sørtun <gunla...@c2i.net> wrote:
> Jack Blankenships wrote:
>>
>> Apparently there was a table there as well, and max-width does not apply
>> to a table very nicely in Safari or Internet Explorer.  Can anyone offer
>> some more explanation on this?
>
> Have only tested for CSS table a year or so back, and it's a known
> behavior in Safari 3. I haven't tested how neither IE7 nor IE8 handles
> max-width on HTML table, or how IE8 handles it on CSS table.
>
> Some browsers seem to ignore min/max-width on table - which seems ok,
> while others apply it - which also can be justified I think. So, I don't
> think Safari and IE8 are wrong, or right, since min/max-width on table
> seems to be in undefined or under-defined CSS territory.
>
> regards
>        Georg
> --
> http://www.gunlaug.no
>
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to