W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2018

Re: [csswg-drafts] [css-tables] table-wrapper box and captions

From: fantasai via GitHub <sysbot+gh@w3.org>
Date: Sat, 03 Feb 2018 21:46:16 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-362857009-1517694375-sysbot+gh@w3.org>
The switch between the old model and the new model was checked in on 2 Jun 2005, so the discussions above after that date are on the new model. Here's the diff, fwiw:

```
Index: tables.src
===================================================================
RCS file: /w3ccvs/WWW/Style/Group/css2-src/tables.src,v
retrieving revision 2.86
retrieving revision 2.87
diff -u -r2.86 -r2.87
--- tables.src	26 May 2005 16:11:47 -0000	2.86
+++ tables.src	2 Jun 2005 22:02:02 -0000	2.87
@@ -1,6 +1,6 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html lang="en">
-<!-- $Id: tables.src,v 2.86 2005/05/26 16:11:47 bbos Exp $ -->
+<!-- $Id: tables.src,v 2.87 2005/06/02 22:02:02 bbos Exp $ -->
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
 <title>Tables</title>
@@ -9,6 +9,15 @@
 <h1>Tables</h1>
 <h2>Introduction to tables</h2>
 
+<p>This chapter defines the processing model for tables in CSS. Part
+of this processing model is the layout. For the layout, this chapter
+introduces two algorithms; the first, the fixed table layout
+algorithm, is well-defined, but the second, the automatic table layout
+algorithm, is not fully defined by this specification.
+
+<p>For the automatic table layout algorithm, some widely deployed
+implementations have achieved relatively close interoperability.
+
 <p><span class="index-def" title="tables">Table</span> layout can be
 used to represent tabular relationships between data. Authors specify
 these relationships in the <a href="conform.html#doclanguage">document
@@ -175,8 +184,10 @@
   (In HTML: THEAD) <dd>Like 'table-row-group', but for visual
   formatting, the row group is always displayed before all other rows
   and row groups and after any top captions. Print user agents may
-  repeat header rows on each page spanned by a table. Use of multiple
-  elements with 'display: table-header-group' is undefined.
+  repeat header rows on each page spanned by a table. If a table
+  contains multiple elements with 'display: table-header-group', only
+  the first is rendered as a header; the others are treated as if they
+  had 'display: table-row-group'.
 
   <dt><strong><span class="index-def" title="table-footer-group"><a
   class="value-def"
@@ -184,8 +195,10 @@
   (In HTML: TFOOT) <dd>Like 'table-row-group', but for visual
   formatting, the row group is always displayed after all other rows
   and row groups and before any bottom captions. Print user agents may
-  repeat footer rows on each page spanned by a table. Use of multiple
-  elements with 'display: table-footer-group' is undefined.
+  repeat footer rows on each page spanned by a table. If a table
+  contains multiple elements with 'display: table-footer-group', only
+  the first is rendered as a footer; the others are treated as if they
+  had 'display: table-row-group'.
 
   <dt><strong><span class="index-def" title="table-column"><a
   class="value-def"
@@ -207,10 +220,9 @@
   <dt><strong><span class="index-def" title="table-caption"><a
   class="value-def"
   name="value-def-table-caption">table-caption</a></span></strong> (In
-  HTML: CAPTION) <dd>Specifies a caption for the table. Use of
-  multiple elements with 'display: table-caption' is undefined; authors
-  should not put more than one element with 'display: table-caption' inside
-  a table or inline-table element.
+  HTML: CAPTION) <dd>Specifies a caption for the table. All elements
+  with 'display: table-caption' must be rendered, as described in
+  <a href="#model">section 17.4.</a>
 </dl>
 
 <p>Replaced elements with these <span
@@ -417,23 +429,34 @@
 </pre>
 </div>
 
-<h2>Tables in the visual formatting model</h2>
+<h2 id=model>Tables in the visual formatting model</h2>
 
-<p>In terms of the <a href="visuren.html">visual formatting model</a>,
-a table may behave like a <a
-href="visuren.html#block-level">block-level</a> or <a
-href="visuren.html#inline-level">inline-level</a> element. Tables have
-content, padding, borders, and margins.
-
-<p>In both cases, the table element generates an <a
-href="visuren.html#anonymous">anonymous</a> box that contains the
-table box itself and the caption's box (if present). The table and
-caption boxes retain their own content, padding, margin, and border
-areas, and the dimensions of the rectangular anonymous box are the
-smallest required to contain both. Vertical margins collapse where the
-table box and caption box touch. Any repositioning of the table must
-move the entire anonymous box, not just the table box, so that the
-caption follows the table.
+<p>In terms of the visual formatting model, a table can behave like a
+<a href="visuren.html#block-level">block-level</a> (for 'display:
+table') or <a href="visuren.html#inline-level">inline-level</a> (for
+'display: inline-table') element.
+
+<p>In both cases, the table box generates an anonymous box that
+contains the table box itself and any caption boxes (in document
+order). The caption boxes are block-level boxes that retain their own
+content, padding, margin, and border areas, and are rendered as normal
+blocks inside the anonymous box. Whether the caption boxes are placed
+before or after the table box is decided by the 'caption-side'
+property, as described below.
+
+<p>The anonymous box is a 'block' box if the table is block-level, and
+an 'inline-block' box if the table is inline-level, except that this
+block is never considered as a block for 'run-in' interaction, and
+that the table box (not the anonymous box) is used when doing baseline
+vertical alignment for an 'inline-table'. The width of the anonymous
+box is the border-edge width of the table box inside it, as described
+by section 17.5.2. Percentages on 'width' on the table are relative to
+the anonymous box's containing block, not the anonymous box itself.
+
+<p>The computed values of properties 'position', 'float', 'margin-*',
+'top', 'right', 'bottom', and 'left' on the table box are used on the
+anonymous box instead of the table box. The table box uses the initial
+values for those properties.
 
 <div class="figure">
 <p><img src="images/top-caption.png" alt="A table with a caption above
@@ -460,15 +483,12 @@
   table box.
 </dl>
 
-<p>Captions above or below a 'table' element are formatted very much
-as if they were a block element before or after the table, except that
-(1) they inherit inheritable properties from the table, and (2) they
-are not considered to be a block box for the purposes of any 'run-in'
-element that may precede the table.
-
-<p>A caption that is above or below a table box also behaves like a
-block box for width and height calculations; the width and height are
-calculated with respect to the table box's containing block.
+<div class=note>
+<p><em><strong>Note:</strong> CSS2 described a different width and
+horizontal alignment behavior. That behavior will be introduced in
+CSS3 using the values 'top-outside' and 'bottom-outside' on this
+property.</em>
+</div>
 
 <p>To align caption content horizontally within the caption box, use
 the <span class="propinst-text-align">'text-align'</span> property.
@@ -547,9 +567,11 @@
 class="propinst-border-spacing">'border-spacing'</span> property.)
 
 <div class="note">
-<p><em><strong>Note.</strong> Table cells may be positioned, but this
-is not recommended: absolute and fixed positioning, as well as
-floating, remove a box from the flow, affecting table size.</em>
+<p><em><strong>Note.</strong> Positioning and floating of table cells
+can cause them not to be table cells anymore, according to the rules
+in <a href="visuren.html#dis-pos-flo">section 9.7</a>. When floating
+is used, the <a>rules on anonymous table objects</a> may cause an
+anonymous cell object to be created as well.</em>
 </div>
 
 <div class="html-example">
@@ -775,9 +797,9 @@
 borders). If the table is wider than the columns, the extra space
 should be distributed over the columns.
 
-<p>It is undefined what happens if a subsequent row has more columns
-than the first. When using 'table-layout: fixed', authors should not
-omit columns from the first row.
+<p>If a subsequent row has more columns than the first, then
+additional columns must not be rendered. When using 'table-layout:
+fixed', authors should not omit columns from the first row.
 
 <p>In this manner, the user agent can begin to lay out the table once
 the entire first row has been received. Cells in subsequent rows do
@@ -794,16 +816,23 @@
 this specification. UAs are not required to implement this algorithm
 to determine the table layout in the case that <span
 class="propinst-table-layout">'table-layout'</span> is 'auto'; they
-can use any other algorithm.
+can use any other algorithm even if it results in different behavior.
+
+<p>Input to the automatic table layout must only include the width of
+the containing block and the content of, and any CSS properties set
+on, the table and any of its descendants.
+
+<div class=note>
+<p><em><strong>Note.</strong> This may be defined in more detail in
+CSS3.</em>
+</div>
+
+<p><em>The remainder of this section is non-normative.</em>
 
 <p>This algorithm may be inefficient since it requires the user agent
 to have access to all the content in the table before determining the
 final layout and may demand more than one pass.
 
-<p>Input to this algorithm must only include the width of the
-containing block and the content of, and any CSS properties set on,
-the table and any of its descendants.
-
 <p>Column widths are determined as follows:
 
 <ol>
@@ -831,6 +860,11 @@
   least as wide as the cell. Do the same for the maximum widths. If
   possible, widen all spanned columns by approximately the same
   amount.
+
+  <li><p>For each column group element with a 'width' other than
+  'auto', increase the minimum widths of the columns it spans, so that
+  together they are at least as wide as the column group's 'width'.
+
 </ol>
 
 <p>This gives a maximum and minimum width for each column. Column
@@ -872,13 +906,12 @@
 'inline-table' element. A value of 'auto' means that the height is the
 sum of the row heights plus any cell spacing or borders. Any other
 value specifies the height explicitly; the table may thus be taller or
-shorter than the height of its rows. CSS&nbsp;2.1 does not specify
-rendering when the specified table height differs from the content
-height, in particular whether content height should override specified
-height; if it doesn't, how extra space should be distributed among
-rows that add up to less than the specified table height; or, if the
-content height exceeds the specified table height, whether the UA
-should provide a scrolling mechanism. <strong>Note.</strong> Future
+shorter than the height of its rows. 
+The <span class="propinst-height">'height'</span> property on 'table'
+boxes is treated as a minimum height. CSS 2.1 does not define how
+extra space is distributed when the 'height' property causes the table
+to be taller than it otherwise would be.
+<strong>Note.</strong> Future
 versions of CSS may specify this further.
 
 <p>The height of a 'table-row' element's box is calculated once the
@@ -889,9 +922,8 @@
 'table-row' means the row height used for layout is MIN. MIN depends
 on cell box heights and cell box alignment (much like the calculation
 of a <a href="visudet.html#line-height">line box</a> height).
-CSS&nbsp;2.1 does not define what percentage values of <span
-class="propinst-height">'height'</span> refer to when specified for
-table rows and row groups.
+Percentage heights on table cells, table rows, and table row groups
+compute to 'auto'.
 
 <p>In CSS&nbsp;2.1, the height of a cell box is the maximum of the
 table cell's <span class="propinst-height">'height'</span> property
@@ -1079,7 +1111,7 @@
 edge to the right inner padding edge (including the border spacing but
 excluding padding and border).
 
-<p>However, in HTML and XHTML, the the width of the &lt;table&gt;
+<p>However, in HTML and XHTML, the width of the &lt;table&gt;
 element is the distance from the left border edge to the right border
 edge.
 ```

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/471#issuecomment-362857009 using your GitHub account
Received on Saturday, 3 February 2018 21:46:20 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:24 UTC