Re: [CSS3 Tables] Column Width Balancing

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 UTC