W3C home > Mailing lists > Public > www-style@w3.org > May 2004

Re: CSS: %% length unit. Proposal. Some clarifications.

From: Max Romantschuk <max@provico.fi>
Date: Mon, 10 May 2004 08:47:26 +0300
Message-ID: <409F176E.3070405@provico.fi>
To: www-style@w3.org

Andrew Fedoniouk wrote:
> I can say that table-* display styles logicaly conflicts with CSS box model.
> Mozilla rendering  of
> <p style="display: table; white-space: nowrap;">
>    <span style="display: table-cell">from:</span>
>    <input type="text" style="display: table-cell;width: 100%;">
> </p>
> is just wrong! Following standard width of <input> must be equal to width of
> <P>.
> Seems like Mozilla is using %% units for that :))) Wohoo!!!

No. You have misunderstood the table layout algorithm. I don't know 
about formal the definitions, but (as was mentioned earlier in this 
thread) when mixing pixels and percents a table cell will stretch best 
it can.

An example, plain old HTML:

<table width="500">
     <td width="100" id="1"></td>
     <td width="100%" id="2"></td>
     <td width="200" id="3"></td>

In this case cell 1 will span 100 pixels, and cell 3 will span 200. Cell 
2 will use up what is left.

You are correct that this is not the way the rest of the box model 
works, but (as was also mentioned earlier) tables predate CSS, and have 
been introduced as is through their respective CSS properties.

Max Romantschuk
Received on Monday, 10 May 2004 02:05:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:13 UTC