[CSS2] More on tables

Ran into a few problems with the spec as I was working out table
background painting in Mozilla and talking with Bernd this past week.

Multi-Column Columns??
======================

http://www.w3.org/TR/CSS21/tables.html#q7

   # A column box occupies **one or more columns** of grid cells.
   # Column boxes are placed next to each other in the order
   # they occur. The first column box may be either on the
   # left or on the right, depending on the value of the
   # 'direction' property of the table.

Each column box should only encompass _one_ column. The source document
may use a single element to represent a sequence of several columns as
in HTML, but this element represents, however, multiple individual
columns and not a grouping of columns. CSS properties should therefore
apply to each of those columns individually, as the 'width' attribute is
in HTML.

   http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4.2

   # The COL element allows authors to group together attribute
   # specifications for table columns. The COL does *not* group
   # columns together structurally -- that is the role of the
   # COLGROUP element. COL elements are empty and serve only as
   # a support for attributes... The width attribute for COL
   # refers to the width of each column in the element's span.
                            ^^^^^^^^^^^

For example, you would want

   <col span="42" style="border: 1px dotted; width: 10em">

to give 42 columns separated by dotted borders, each 10em wide,
not 42 columns squeezed into a dotted box 10em wide.

WinIE, Opera, and Mozilla all seem to follow this interpretation.
(Opera and Mozilla respect borders, WinIE and Mozilla respect width.)


Unseen Rows
===========

   http://www.w3.org/TR/CSS21/tables.html#empty-cells

   # A value of 'hide' means that no borders or backgrounds are
   # drawn around/behind empty cells (see point 6 in 17.5.1).
   # Furthermore, if all the cells in a row have a value of 'hide'
   # and have no visible content, the entire row behaves as if it
   # had 'display: none'.

The entire row should behave as if it had 'visibility: collapse'.
Simple reason why: cells in a row with 'visibility: collapse'
still affect column widths, and cells in a row with "empty-cells:
hide" should, too.

WinIE, Opera, and Mozilla all have this interpretation.


BTW, with respect to Bernd's concerns in
   http://lists.w3.org/Archives/Public/www-style/2004Jan/0221.html -
the first sentence of that could be rewritten

   "A value of 'hide' means that borders and backgrounds drawn
    around/behind empty cells are invisible (see point 6 in 17.5.1)."


Border-Collapse Border-Box Dimensions
=====================================

The problems with collapsed outer table borders noted in
   http://lists.w3.org/Archives/Public/www-style/2003Mar/0003.html
don't seem to have been addressed by the last draft.

I'd like to note that this problem *has* to be addressed by
incorporating the outer border into the margin space, not the
border space or the overflow. Otherwise, you get some really
awful renderings. See
   http://fantasai.inkedblade.net/style/demos/border-collapse-overflow/
for a demonstration.


Also, nowhere does the specification specify what the "border box"
dimensions of table elements such as table cells should be. This
is important for determining background boundaries, border-box
widths, and suchlike.

I propose that border-collapse border box dimensions be measured
from the grid lines, that is, the half-way point of its borders.
This can be added by inserting the following sentence:

   "The border edge of a table element in the border collapse
    model is defined to be along these grid lines."

after the first sentence of the second paragraph in section 17.6.2.

The result reads:

   | Borders are centered on the grid lines between the cells.
   | The border edge of a table element in the border collapse
   | model is defined to be along these grid lines. User agents
   | must find a consistent rule for rounding off in the case
   | of an odd number of discrete units (screen pixels, printer
   | dots).


Anonymous Row Groups
====================

   http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes

There seem to be no provisions for allowing the UA to generate
anonymous row groups to contain rows directly inside a table.
I can't say anything for sure about other UAs, but I suspect
implementing a table box object that may contain an arbitrary
mixture of table row groups and table rows would be somewhat
nightmarish and could be cleanly simplified by creating row
groups to contain the bare table rows. Mozilla takes this
approach. The CSS spec could explicitly allow this with the
following rule:

   "If the parent P of a 'table-row' element T is not a
    'table-row-group', 'table-header-group', or 'table-footer-group',
    an object corresponding to a 'table-row-group' may be generated
    between P and T. This object will span all consecutive 'table-row'
    siblings (in the document tree) of T."

~fantasai

Received on Monday, 9 February 2004 05:53:13 UTC