W3C home > Mailing lists > Public > www-style@w3.org > July 2009

RE: question on width calculation for floats and tables nested inside a div

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Tue, 7 Jul 2009 21:28:21 +0000
To: Dirk Pranke <dpranke@google.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <045A765940533D4CA4933A4A7E32597E020C05B6@TK5EX14MBXC111.redmond.corp.microsoft.com>
> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
> Behalf Of Dirk Pranke


> Subject: question on width calculation for floats and tables nested
> inside a div
>
> Hi all,
>
> In the course of investigating a bug in WebKit, I've run across some
> ambiguity on how to render tables sized at width:100% inside a div
> that also has a float in it.
>
> That sentence is a bit hard to parse, so this is best illustrated by
> looking at the example:
> https://bugs.webkit.org/attachment.cgi?id=32157


I note that IE8, Opera 9.6, Firefox 3.5 and Safari 4 render this markup interoperably when the table is
display:inline-table. The result matches #3 in your description.

My guess is that the table width is computed per table width algorithms in CSS2.1 17.5.2 resulting in its overflow in some browsers and its clearance in others. In other words, the containing block's width is taken into account to size the table, not the available space left by the left float.

Fwiw, I would have expected #1 in this case.
Received on Tuesday, 7 July 2009 21:29:05 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:19 GMT