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

> -----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 UTC