W3C home > Mailing lists > Public > www-style@w3.org > September 2007

Re: [CSS3 Tables] Column Width Balancing

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 12 Sep 2007 11:17:39 +0800
To: www-style@w3.org
Message-ID: <20070912031739.GA15466@ridley.dbaron.org>

On Tuesday 2007-09-11 03:41 -0400, fantasai wrote:
> 
> This is my understanding of David Baron's presentation on column width 
> balancing.
> (Note to www-style: this is intended to reflect current implementations.)
> 
> Once each column's minimum content width (MCW) and preferred width (PW) is
> calculated and the final table width is known:

For a start, there are four classes of columns:
 1. those with nonzero percentage widths
 2. those with nonzero specified widths (and not in the first class)
 3. those with nonzero preferred widths (and not in the first 2 classes)
 4. those with all zero widths

Note that the preferred width of columns with percentage widths is
the percentage times the width of the table that we're distributing
(which excludes the border-spacing, padding, and border), or the
minimum width if that is larger.  The preferred width of columns
with specified widths is their specified width (which already
includes the minimum width).

> If the final table width is the sum of the columns' MCWs, each column gets 
> its
> MCW. If there is excess width (final width - sum of MCWs), then the excess 
> gets
> distributed as follows:
> 
> 1. Distribute the excess width to the columns with percentage widths in 
> proportion
>    to their percentages, but not beyond satisfying their specified widths.

In proportion to the difference between the minimum widths and their
percentage widths.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Wednesday, 12 September 2007 03:43:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:52 GMT