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.)

These are proposed rules that belong in the "Computing table widths"
section of http://dbaron.org/css/intrinsic/ .  Their purpose is,
given a final table width (with the necessary border-spacing, table
border, and table padding subtracted), to allocate that width among
the columns.

For a given table width, we either assign one of the following sets
of column widths or a weighted average of two adjacent sets of
widths (that surround the width of the table) so that the total
widths assigned add up to the width of the table.  It is not
possible to assign values smaller than the smallest set of widths.
However, see below for handling the case of assigning values larger
than the largest set of widths.  From smallest to largest, these
are:

1. Assign all columns their min width.

2. Assign all columns with percentage widths
their percentage width, and all other columns their min width.

3. Assign all columns with percentage widths
their percentage width, all columns with specified coordinate
widths their pref width (since it doesn't matter whether it's the
largest contributor to the pref width that was the specified
contributor), and all other columns their min width.

4. Assign all columns with percentage widths their
specified width, and all other columns their pref width.

If the table's width is *larger* than what we would assign in (4), then
we expand the columns:

  a. if any columns without a specified coordinate width or
  percent width have nonzero pref width, in proportion to pref
  width

  b. otherwise, if any columns without percent width have nonzero
  pref width, in proportion to pref width

  c. otherwise, if any columns have nonzero percentage widths, in
  proportion to the percentage widths

  d. otherwise, equally.

The table's width cannot be smaller than (1).

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Tuesday, 11 September 2007 08:15:16 UTC