|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | 2 | <html lang="en"> |
3 | | -<!-- $Id: tables.src,v 2.55 2002-08-07 18:19:16 bbos Exp $ --> |
| 3 | +<!-- $Id: tables.src,v 2.56 2002-11-28 20:56:38 bbos Exp $ --> |
4 | 4 | <head> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> |
6 | 6 | <title>Tables</title> |
@@ -614,34 +614,56 @@ class="caption">Schema of table layers. |
614 | 614 | itself. Like all boxes, it may be transparent.</p> |
615 | 615 | </li> |
616 | 616 | <li> |
617 | | -<p>The next layer contains the column groups. The columns groups are |
618 | | -as tall as the table, but they need not cover the whole table |
619 | | -horizontally.</p> |
| 617 | +<p>The next layer contains the column groups. Each column group |
| 618 | +extends from the top of the cells in the top row to the bottom of the |
| 619 | +cells on the bottom row and from the left edge of its leftmost column |
| 620 | +to the right edge of its rightmost column. The background extends to |
| 621 | +cover the full area of all cells that originate in the column group, |
| 622 | +but this extension does not affect background image positioning. |
620 | 623 | </li> |
621 | 624 | <li> |
622 | 625 | <p>On top of the column groups are the areas representing the column |
623 | | -boxes. Like column groups, columns are as tall as the table, but need |
624 | | -not cover the whole table horizontally.</p> |
| 626 | +boxes. Each column is as tall as the column groups and as wide as a |
| 627 | +normal (single-column-spanning) cell in the column. The background |
| 628 | +extends to cover the full area of all cells that originate in the |
| 629 | +column, even if they span outside the column, but this this extension |
| 630 | +does not affect background image positioning. |
625 | 631 | </li> |
626 | 632 | <li> |
627 | | -<p>Next is the layer containing the row groups. Each row group is as |
628 | | -wide as the table. Together, the row groups completely cover the table |
629 | | -from top to bottom.</p> |
| 633 | +<p>Next is the layer containing the row groups. Each row group extends |
| 634 | +from the top left corner of its topmost cell in the first column to |
| 635 | +the bottom right corner of its bottommost cell in the last column. |
630 | 636 | </li> |
631 | 637 | <li> |
632 | | -<p>The next to last layer contains the rows. The rows also cover the |
633 | | -whole table.</p> |
| 638 | +<p>The next to last layer contains the rows. Each row is as wide as |
| 639 | +the row groups and as tall as a normal (single-row-spanning) cell in |
| 640 | +the row. As with columns, the background extends to cover the full |
| 641 | +area of all cells that originate in the row, even if they span outside |
| 642 | +the row, but this this extension does not affect background image |
| 643 | +positioning. |
634 | 644 | </li> |
635 | 645 | <li> |
636 | 646 | <p>The topmost layer contains the cells themselves. As the figure |
637 | 647 | shows, although all rows contain the same number of cells, not every |
638 | | -cell may have specified content. These "empty" cells are transparent |
639 | | -if the value of their 'empty-cells' property is 'hide', letting lower |
640 | | -layers shine through. |
641 | | -</p> |
| 648 | +cell may have specified content. If the value of their <span |
| 649 | +class="propinst-empty-cells">'empty-cells'</span> property is 'hide' |
| 650 | +these "empty" cells are transparent through the cell, row, row group, |
| 651 | +column and column group backgrounds, letting the table background show |
| 652 | +through. |
642 | 653 | </li> |
643 | 654 | </ol> |
644 | 655 |
|
| 656 | +<p>The edges of the rows, columns, row groups and column groups in the |
| 657 | +<a href="#collapsing-borders">collapsing borders model</a> concide |
| 658 | +with the hypothetical grid lines on which the borders of the cells are |
| 659 | +centered. (And thus, in this model, the rows together exactly cover |
| 660 | +the table, leaving no gaps; ditto for the columns.) In the <a |
| 661 | +href="#separated-borders">separated borders model,</a> the edges |
| 662 | +coincide with the <a href="box.html#border-edge">border edges</a> of |
| 663 | +cells. (And thus, in this model, there may be gaps between the rows |
| 664 | +and columns, corresponding to the <span |
| 665 | +class="propinst-border-spacing">'border-spacing'</span> property.) |
| 666 | + |
645 | 667 | <div class="html-example"> |
646 | 668 | <P>In the following example, the first row contains four cells, but |
647 | 669 | the second row contains no cells, and thus the table background shines |
@@ -739,6 +761,16 @@ class="propinst-width">'width'</span> property. A value of 'auto' (for |
739 | 761 | both 'display: table' and 'display: inline-table') means use the <a |
740 | 762 | href="#auto-table-layout">automatic table layout</a> algorithm. |
741 | 763 |
|
| 764 | +<p class=note style="color:red">[Possible change to that last |
| 765 | +sentence: the width of a table (but not of an 'inline-table') could in |
| 766 | +principle be derived from the containing block's width, exactly as for |
| 767 | +block elements, allowing the fixed layout algorithm to be used even if |
| 768 | +'width' is 'auto'. This would in addition allow 'table {margin: 1em; |
| 769 | +table-layout: fixed}' to create a table that is 100% - 2em wide. |
| 770 | +Suggestion by <a |
| 771 | +href="http://lists.w3.org/Archives/Public/www-style/2002Aug/0286.html"> |
| 772 | +Fantasai.</a>] |
| 773 | + |
742 | 774 | <P>In the fixed table layout algorithm, the width of each column is |
743 | 775 | determined as follows:</p> |
744 | 776 |
|
@@ -1004,8 +1036,9 @@ negative. |
1004 | 1036 |
|
1005 | 1037 | <p>In this model, each cell has an individual border. The |
1006 | 1038 | <span class="propinst-border-spacing">'border-spacing'</span> property |
1007 | | -specifies the distance between the borders of adjacent cells. This |
1008 | | -space is filled with the background of the table element. Rows, |
| 1039 | +specifies the distance between the borders of adjacent cells. In this |
| 1040 | +space, the row, column, row group, and column group backgrounds are |
| 1041 | +invisible, allowing the table background to show through. Rows, |
1009 | 1042 | columns, row groups, and column groups cannot have borders (i.e., user |
1010 | 1043 | agents must <span class="index-inst" title="ignore"><a |
1011 | 1044 | href="syndata.html#ignore">ignore</a></span> the border properties for |
@@ -1046,10 +1079,12 @@ includes "&nbsp;" and other whitespace except ASCII CR ("\0D"), LF |
1046 | 1079 | ("\0A"), tab ("\09"), and space ("\20"). |
1047 | 1080 |
|
1048 | 1081 | <P>When this property has the value 'show', borders and backgrounds |
1049 | | -are drawn around empty cells (like normal cells). |
| 1082 | +are drawn around/behind empty cells (like normal cells). |
1050 | 1083 |
|
1051 | 1084 | <P>A value of 'hide' means that no borders or backgrounds are drawn |
1052 | | -around empty cells. Furthermore, if all the cells in a row have a |
| 1085 | +around/behind empty cells (see point 6 in <a |
| 1086 | +href="#table-layers">17.5.1</a>). Furthermore, if all the cells in a |
| 1087 | +row have a |
1053 | 1088 | value of 'hide' and have no visible content, the entire row behaves as |
1054 | 1089 | if it had 'display: none'. |
1055 | 1090 |
|
@@ -1135,13 +1170,14 @@ value for the border style.) |
1135 | 1170 | <li>If none of the styles is 'hidden' and at least one of them is not |
1136 | 1171 | 'none', then narrow borders are discarded in favor of wider ones. If |
1137 | 1172 | several have the same <span |
1138 | | -class="propinst-border-width">'border-width'</span> than styles are |
| 1173 | +class="propinst-border-width">'border-width'</span> then styles are |
1139 | 1174 | preferred in this order: 'double', 'solid', 'dashed', 'dotted', |
1140 | 1175 | 'ridge', 'outset', 'groove', and the lowest: 'inset'. |
1141 | 1176 |
|
1142 | 1177 | <li>If border styles differ only in color, then a style set on a cell |
1143 | 1178 | wins over one on a row, which wins over a row group, column, column |
1144 | | -group and, lastly, table. |
| 1179 | +group and, lastly, table. It is undefined which color is used when |
| 1180 | +two elements of the same type disagree. |
1145 | 1181 | </ol> |
1146 | 1182 |
|
1147 | 1183 | <div class="example"> |
|
0 commit comments