-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.src.html
2722 lines (2230 loc) · 94 KB
/
Overview.src.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta charset=utf8>
<title>CSS3 Tables Module</title>
<link rel="stylesheet" type="text/css" href="../default.css">
<style type="text/css">
/* Just in case an incorrect max-width occurs in default.css */
body {max-width: none !important}
</style>
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-MO">
</head>
<body>
<div class="head">
<!--logo-->
<h1>CSS3 Tables Module</h1>
<h2 class="no-num no-toc">[LONGSTATUS] [DATE: 21 Feb 2002]</h2>
<dl>
<dt>This version:</dt>
<dd><a
href="[VERSION]">http://www.w3.org/[YEAR]/MO-css3-tables-[CDATE]</a></dd>
<dt>Latest version:</dt>
<dd><a
href="[LATEST]">[LATEST]</a></dd>
<dt>Previous version:</dt>
<dd><a
href="[http://www.w3.org/PreviousVersionURI]">[http://www.w3.org/PreviousVersionURI]</a></dd>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-tables%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-tables] <var>… message topic …</var></kbd>”
(<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)
<dt>Editors:</dt>
<dd><a href="http://www.w3.org/People/Bos">Bert Bos</a>, <a
href="http://www.w3.org/">W3C</a>, <a
href="mailto:bert@w3.org"><bert@w3.org></a></dd>
<dd>[editor name, affiliation (opt.), email address (opt.)]</dd>
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<h2 id=abstract class="no-num no-toc">Abstract</h2>
<p>CSS (Cascading Style Sheets) is a language for specifying the
rendering of a structured document (in HTML or XML). See the CSS3
introduction [[CSS3INTRO]] for more on CSS. The <em>CSS3 table
module</em> is one of the modules of level 3 of CSS and defines the
properties that specify how tables are to be displayed visually or
spoken by a speech synthesizer.
<p>This is a very rough draft. It consists of the text of
the CSS2 chapter on tables, with almost no changes yet., except for
the addition of the first section, "Tabs & leaders."
<h2 id=status class="no-num no-toc">Status of this document</h2>
<details class="annoying-warning" open>
<summary>This document is obsolete.</summary>
This specification is not being actively maintained, and should not be used as a guide for implementations. It may be revived in the future, but for now should be considered obsolete. <br>If you have questions or comments on this specification, please send an email to the CSS Working Group's mailing list at <a href="mailto:www-style@w3.org">www-style@w3.org</a>. (Before sending mail for the first time, you have to subscribe at <a href="http://lists.w3.org/Archives/Public/www-style/">http://lists.w3.org/Archives/Public/www-style/</a>.)
</details>
<!--status-->
<p>The text hasn't yet been synchronized with the latest version of
CSS 2.1.
<h2 class="no-num no-toc"><a name="contents">Table of contents</a></h2>
<!--toc-->
<hr>
<h2>Dependencies on other modules</h2>
<p>This CSS3 module depends on the following other CSS3 modules:
<ul>
<li>CSS3 Box Model [[!CSS3BOX]]
<li>CSS3 Syntax Module [[!CSS3SYN]]
<li>CSS3 Values and Units Module [[!CSS3VAL]]
<li>[module]
</ul>
<h2>The 'tab' properties: tabs and leaders</h2>
<p class="issue">[Does it belong here, or in the line box model?]
<p class="issue">[This material is new. (Well, actually, <a
href="css-tabs.html">it dates from 1996</a>, but it is new in this
draft.) Not reviewed yet in any way.]
<p class="issue">[The name "tab" maybe reminds people too much of the tab
character, which plays no role here at all. Maybe a different name is better.
"Anchor"?]
<p class="issue">[Could this be merged with the margin-left/margin-right
properties to save some properties? 'margin-left: 25% fixed' instead of 'tab:
25% left'?]
<p class=issue>Håkon will write a proposal for a
'leader(<string>)' notation that can be put in the 'content'
property, inside '::after' and '::before', independent of any tab
properties. It will push everything after it (up to the end of the
block or the explicit next line break, whichever comes first) forward,
so that it ends at the end of a line. Often, that may make tabs
unnecessary. [12 Jan 2005] That proposal is now in [[CSS3GCPM]].
<table class="propdef">
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn>tab-position</dfn>
<tr>
<td><em>Value:</em>
<td><var><length></var> | <var><percentage></var>
<tr>
<td><em>Initial:</em>
<td>0
<tr>
<td><em>Applies to:</em>
<td>inline-level elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>width* of containing block
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td><length>
<tr>
<td colspan="2">*) if the containing block is 'horizontal', otherwise
height
</table>
<table class="propdef">
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn>tab-align</dfn>
<tr>
<td><em>Value:</em>
<td>left | top | center | right | bottom | <var><string></var> |
none
<tr>
<td><em>Initial:</em>
<td>none
<tr>
<td><em>Applies to:</em>
<td>inline-level elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value
</table>
<table class="propdef">
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn>tab-leaders</dfn>
<tr>
<td><em>Value:</em>
<td><var><string></var>
<tr>
<td><em>Initial:</em>
<td>"" (empty string)
<tr>
<td><em>Applies to:</em>
<td>inline-level elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value
</table>
<table class="propdef">
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn>tab-leaders-alignment</dfn>
<tr>
<td><em>Value:</em>
<td>aligned | centered | distributed
<tr>
<td><em>Initial:</em>
<td>aligned
<tr>
<td><em>Applies to:</em>
<td>inline-level elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value
</table>
<table class="propdef">
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn>tab</dfn>
<tr>
<td><em>Value:</em>
<td>[ <'tab-position'> || <'tab-align'> ] [ / [
<'tab-leaders'> || <'tab-leaders-alignment'> ] ]?
<tr>
<td><em>Initial:</em>
<td>see individual properties
<tr>
<td><em>Applies to:</em>
<td>inline-level elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>see individual properties
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>see individual properties
</table>
<p>An inline element can be put at a specific position in the line by setting
the element's <span class="property">'tab'</span> property. The space that
creates before the element can be filled with <dfn>leaders</dfn> or left
blank.
<div class="example">
<p>Here are some examples:
<pre>signature { tab: 100% right } /* right-aligned at end of line */
amount { tab: -1em "." } /* aligned on dot, 1em from end of line */
desc { tab: 0 left } /* left-aligned to start of line */
pageno { tab: 100% right / " . " } /* right-aligned, with dot leaders */
col2 { tab: 50% center / " · " } /* centered in the line */</pre>
<p>With a document fragment like the following:
<pre><expenses>
<desc>Hotel</desc> <amount>374.55</amount>
<desc>Travel</desc> <amount>1460.10</amount>
<desc>Miscellaneous, including presents and
tips</desc> <amount>84.00</amount>
<desc>Total</desc> <amount>1918.65</amount>
<signature>Ph. Fogg</signature>
</expenses></pre>
<p>The rendering might be as follows:
<div class="figure">
<p><img src="tabs.png" alt="[image]">
<p class="caption">Possible rendering of a text with tabs and leaders
</div>
</div>
<p>The <span class="property">'tab-position'</span> and <span
class="property">'tab-align'</span> determine the position of the element in
the line. The element is positioned by inserting extra whitespace or leaders
before it. Setting a tab will never cause the element to overlap any other
element on the line (unless it would already overlap without the tab, because
of negative margins). It may be necessary for the UA to insert so much
whitespace/leaders, that the alignment point of the tab occurs on one of the
following lines. (The example above shows one such case.)
<p>The <span class="property">'tab-position'</span> gives the position of a
point on the line to which the element will be aligned. A negative
<var><length></var> is measured from the end of the line, a nonnegative
one from the beginning. Ditto for percentages, where percentages are relative
to the width of the <span>containing block</span> (or height, if the
containing block's <span>orientation</span> is vertical). It depends on the
writing mode of the containing block which edge is the start of the line.
<span class="issue">[Or is it more intuitive to always count positive lengths
from the left or top and negative ones from the right or bottom?]</span>
<p>The position is measured from the <em>content edge</em> of the containing
block and is independent of any floats that may make the line box narrower
than the content box. As usual for inline elements in the presence of floats,
the alignment point and the element to which it belongs will be moved to a
following line, if it would otherwise overlap the float.
<p class="note">Note that a value of '0' means the start of the line. Use
100% to refer to the end of the line.
<p><span class="property">'Tab-align'</span> specifies how the element is
aligned to the alignment point:
<dl>
<dt>'none'</dt>
<dd>The element is not aligned to any alignment point and is put
immediately after the previous element, with no intervening
leaders.</dd>
<dt>'left', 'top'</dt>
<dd>These are the same and mean that the left <em>margin edge</em> (or
top, if vertical) of the element is at the given position in the line.
<p>If the element consists of multiple boxes (because of bidi
processing or line breaks), which of the boxes is aligned depends on
the <span class="property">'direction'</span> of the containing block:
the first box in the case of <span class="css">'ltr'</span>, the last
box in the case of <span class="css">'rtl'</span>.
</dd>
<dt>'right', 'bottom'</dt>
<dd>The right <em>margin edge</em> (or bottom, if vertical) is at the
given position. If the <span class="property">'direction'</span> of the
containing block is <span class="css">'ltr'</span>, the element's last
box is aligned, otherwise the first box.</dd>
<dt>'center'</dt>
<dd>The element is centered around the given position. If a line break
occurs inside the element, the element might not be centered
exactly.</dd>
<dt><var><string></var></dt>
<dd>The beginning of the first occurrence of the string in the element is
put at the alignment point. If the string does not occur in the
element, the end of the content of the element is aligned.</dd>
</dl>
<p class="issue">[Do we need 'start' and 'end' keywords that dynamically
resolve to 'left' or 'right' depending on the writing direction? Probably not
very useful. Ltr and rtl are not symmetrical: even in rtl text, numbers are
right aligned.]
<p>The <span class="property">'tab-leaders'</span> property determines what
is inserted before the element to make it align. If the value is the empty
string, only whitespace is inserted, otherwise multiple copies of the string
are inserted, as many as needed. If there is not room for a whole number of
copies, the remaining part is filled with whitespace. The style (color, font,
etc.) of the leaders is that of the element's parent (i.e., not necessarily
the same as the element's own style).
<p>The values of <span class="property">'tab-leaders-alignment'</span> have
the following meaning:
<dl>
<dt>'centered'</dt>
<dd>If the space for the leaders is not a whole number of copies of the
<span class="property">'tab-leaders'</span> string, half of the extra
whitespace is inserted before the first string, and half after the last
string. (If there is a line break the middle of the leaders, it may not
be possible to have exactly half the space on both sides.)</dd>
<dt>'distributed'</dt>
<dd>Like for <span class="css">'centered'</span>, but the extra
whitespace is inserted in equal amounts before the first, after the
last and between the strings.</dd>
<dt>'aligned'</dt>
<dd>The <span class="property">'tab-leaders'</span> strings are
positioned such that there is room for exactly a whole number of copies
between the string and the left content edge of the containing block.
<span class="note">Note that this has the effect that all 'aligned'
leaders on different lines are aligned with each other, as if they were
attached to a common grid. The dot leaders in the previous example form
such a grid.</span></dd>
</dl>
<p>The <span class="property">'tab'</span> property is a shorthand to set all
four properties together. Omitted values default to their initial values.
<p class="note">Note the slash (/) in the value of <span
class="property">'tab'</span>: if leaders are specified, they must be
separated from the position & alignment with a slash.
<p class="note">Note that <span class="css">'tab: 2em / "."'</span> is a
valid, and occasionally useful declaration, but by itself does not cause any
leaders to appear, because it implicitly sets <span
class="property">'tab-align'</span> to <span class="css">'none'</span>.
<p>Justification and line breaking algorithms may change the size of an
element, but leave it aligned at the alignment point. (Although different
algorithms and different settings of the relevant properties may cause the
alignment point to fall on different lines.)
<p class="issue">[Do we need keywords such as 'arrow-leader (for a stretchy
arrow) or 'double-arrow-leader', or can they be made from existing
characters? Or should 'tab-leaders' accept up to 3 strings, e.g., "\2190"
"\2500" "\2192" ("←" "─" "→"), for start, middle and end
of the leaders?]
<h2>Introduction to tables</h2>
<p class=issue>What happens with tables in vertical text
('writing-mode: tb-rl' etc.)? Are tables rotated or not? Currently,
the specification says rows are horizontal and the only influence is
from 'direction', which may cause the next column to be on the left of
the current one instead of the right.
<p>Table mark-up in a source document typically represents a
particular relationship between three or more dimensions of data,
e.g., dates, products and the number of units sold. Table properties
in CSS are meant to style the representation of such data as a table.
But the properties can occasionally also be used to align elements in
rows and columns for purely visual reasons, rather than semantics.
Unlike, e.g., the <code class=html>table</code> element in HTML, the
<span class=property>'table'</span> keyword doesn't imply any
particular semantic relation between elements in the document.
<div class=example><p>
Here is a simple three-row, three-column
table described in HTML 4:
<pre class="html-example">
<TABLE>
<CAPTION>This is a simple 3x3 table</CAPTION>
<TR id="row1">
<TH>Header 1 <TD>Cell 1 <TD>Cell 2
<TR id="row2">
<TH>Header 2 <TD>Cell 3 <TD>Cell 4
<TR id="row3">
<TH>Header 3 <TD>Cell 5 <TD>Cell 6
</TABLE>
</pre>
<p>This code creates one table (the <code class=html>TABLE</code>
element), three rows (the <code class=html>TR</code> elements), three
header cells (the <code class=html>TH</code> elements), and six data
cells (the <code class=html>TD</code> elements). Note that the three
columns of this example are specified implicitly: there are as many
columns in the table as required by header and data cells.
<p>The following CSS rule centers the text horizontally in the header
cells and presents the text in the header cells with a bold font
weight:
<pre>
th { text-align: center; font-weight: bold }
</pre>
<p>The next rules align the text of the header cells on their baseline
and vertically center the text in each data cell:
<pre>
th { vertical-align: baseline }
td { vertical-align: middle }
</pre>
<p>The next rules specify that the top row will be surrounded by a 3px
solid blue border and each of the other rows will be surrounded by a
1px solid black border:
<pre>
table { border-collapse: collapse }
tr#row1 { border: 3px solid blue }
tr#row2 { border: 1px solid black }
tr#row3 { border: 1px solid black }
</pre>
<p>Note, however, that the borders around the rows overlap where the
rows meet. What color (black or blue) and thickness (1px or 3px) will
the border between row1 and row2 be? We discuss this in the section on
<a href="#border-conflict-resolution">border conflict resolution.</a>
<p>The following rule puts the table caption above the table:
<pre>
caption { caption-side: top }
</pre>
</div>
<p>The preceding example shows how CSS works with HTML 4 elements;
in HTML 4, the semantics of the various table elements (TABLE,
CAPTION, THEAD, TBODY, TFOOT, COL, COLGROUP, TH, and TD) are
well-defined. In other document languages (such as XML applications),
there may not be pre-defined table elements. Therefore, CSS 2.1 allows
authors to <span class="index-inst" title="mapping elements to table
parts">"map"</span> document language elements to table elements via
the <span class="propinst-display">'display'</span> property. For
example, the following rule makes the FOO element act like an HTML
TABLE element and the BAR element act like a CAPTION element:</p>
<PRE class="example">
FOO { display : table }
BAR { display : table-caption }
</pre>
<p id=internal>We discuss the various table elements in the
following section. In
this specification, the term <span class="index-def" title="table
element"><dfn>table element</dfn></span> refers to any element
involved in the creation of a table. An <span class="index-def"
title="internal table element|table
element::internal">“internal”
table element</span> is one that produces a row, row group, column,
column group, or cell.
<h2>The CSS table model</h2>
<p>The CSS table model is based on the HTML 4.0 table model, in
which the structure of a table closely parallels the visual layout of
the table. In this model, a table consists of an optional caption and
any number of rows of cells. The table model is said to be “row
primary,” since authors specify rows, not columns, explicitly in the
document language. Columns are derived once all the rows have been
specified: the first cell of each row belongs to the first column,
the second to the second column, etc.). Rows and columns may be
grouped structurally and this grouping reflected in presentation
(e.g., a border may be drawn around a group of rows).
<p>Thus, the table model consists of tables, captions, rows, row
groups, columns, column groups, and cells.
<p>The CSS model does not require that the <span>document
language</span> include elements
that correspond to each of these components. For document languages
(such as XML applications) that do not have pre-defined table
elements, authors must map document language elements to table
elements; this is done with the
'display' property. The following
'display' values assign table
formatting rules to an arbitrary element:
<dl>
<dt><dfn>table</dfn> (In HTML: TABLE) <dd>Specifies that an element
defines a <em>block-level</em> table: it is a rectangular block that
participates in a <em>block formatting context</em>.
<dt><dfn>inline-table</dfn> (In HTML: TABLE) <dd>Specifies that an
element defines an <em>inline-level</em> table: it is a rectangular
block that participates in an <em>inline formatting context</em>.
<dt><dfn>table-row</dfn> (In HTML:
TR) <dd>Specifies that an element is a row of cells.
<dt><dfn>table-row-group</dfn>
(In HTML: TBODY) <dd>Specifies that an element groups one or more
rows.
<dt><dfn>table-header-group</dfn>
(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. 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><dfn>table-footer-group</dfn>
(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. 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><dfn>table-column</dfn> (In
HTML: COL) <dd>Specifies that an element describes a column of
cells.
<dt><dfn>table-column-group</dfn>
(In HTML: COLGROUP) <dd>Specifies that an element groups one or more
columns.
<dt><dfn>table-cell</dfn> (In HTML:
TD, TH) <dd>Specifies that an element represents a table cell.
<dt><dfn>table-caption</dfn> (In
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 [??].</a>
</dl>
<p>Replaced elements with these
'display' values are treated as their
given display types during layout. For example, an image that is set
to 'display: table-cell' will fill the available cell space, and its
dimensions might contribute towards the table sizing algorithms, as
with an ordinary cell.
<p>Elements with 'display' set
to 'table-column' or 'table-column-group' are not rendered (exactly as
if they had 'display: none'), but they are useful, because they may
have attributes which induce a certain style for the columns they
represent.
<div class=issue>
<p>The above, rewritten for 'display-model' and 'display-role':
<p>The values of <span class=property>'display-model'</span> that
apply to tables have the following meaning. (For the purposes of the
definitions in this section, any child elements with a <span
class=property>'display-role'</span> of <span class=css>'none'</span>
are considered to have been removed from the document tree.)
<dl>
<dt>table
<dd>
<p>The child elements are laid out as a stack of row-groups. In
detail:
<p>Any uninterrupted sequence of child elements, including
anonymous ones, with a role other than <span
class=css>'table-{row,header,footer}-group'</span> or <span
class=css>'table-caption'</span> is wrapped in an anonymous
element with role and model both set to <span
class=css>'table-row-group'</span>.
<p>The resulting set of children is laid out as a stack of rows
from top to bottom, with at the top any <span
class=css>'table-header-group'</span> child, then the <span
class=css>'table-row-group'</span> children, in the order of the
document, and finally any <span
class=css>'table-footer-group'</span> child. (Note also the
difference between these three types for paged media, described <a
href="#table-header-group">below.</a>)
<dt>table-row-group
<dd>
<p>The children are laid out as a stack of rows. In detail:
<p>Any uninterrupted sequence of child elements with a role other
than <span class=css>'table-row'</span> is wrapped in an anonymous
element with role set to <span class=css>'table-row'</span> and
model set to <span class=css>'block-inside'</span>.
<p>The resulting children are laid out as a stack of rows from top
to bottom in the order of the document.
<dt>table-row
<dd>
<p>The children are laid out as a row of table cells. In detail:
<p>Any uninterrupted sequence of children with a role other than
<span class=css>'table-cell'</span> is wrapped in an anonymous
element with role set to <span class=css>'table-cell'</span> and
model set to <span class=css>'block'</span>.
<p>The resulting children are laid out from left to right in the
order of the document.
<dt>table-column-group
<dd>
<p>Any children with a role other than <span
class=css>'table-column'</span> are ignored. The other children
aren't rendered either, but some of their properties influence the
style of the table. See the section <a
href="#columns">Columns</a> below.
<dt>table-column
<dd>
<p>All children are ignored (as if their <span
class=property>'display-role'</span> was <span class=css>'none'</span>)
See the section <a href="#columns">Columns</a> below for the
function of properties on this element.
</dl>
<p>See <a href="#width-layout">Table width algorithms</a> and <a
href="#height-layout">Table height algorithms</a> for the size of the
various elements.
<p>Where it says “top to bottom” or “left to
right” in the definitions above, this should be replaced by the
appropriate direction based on the value of <span
class=property>'writing-mode'</span> of the enclosing <span
class=css>'table'</span> element, as follows. (Note that the writing
mode of other elements in the table may influence the direction of the
context of the table cells, but only the writing mode of the table
element itself determines the direction of the rows and columns.)
<dl>
<dt>lr-tb <dd>Rows are stacked top to bottom and columns are laid
out from left to right (i.e., as in the definitions above).
<dt>rl-tb <dd>Rows are stacked top to bottom and columns are laid
out right to left.
<dt>tb-rl <dd>Rows are laid out from right to left and columns from
top to bottom.
<dt>tb-lr <dd>Rows are laid out from left to right and columns from
top to bottom.
</dl>
<p class=note>Note that there are theoretically 8 ways that rows and
columns can be ordered, but only the above 4 are supported.
<p>The values of <span class=property>'table-role'</span> have the
following meaning
<dl>
<dt>table-cell
<dd>
<p>The element is a cell in a table row. If the parent, anonymous
or not, doesn't have the model <span class=css>'table-row'</span>,
an anonymous element is wrapped around this element and all its
sister elements with the same role that form an uninterupted
sequence. The anonymous element has a role and a model of <span
class=css>'table-row'</span>.
<dt>table-caption
<dd>
<p>The element is the caption of a table. If the parent, anonymous
or not, has a model other than <span class=css>'table'</span>, an
anonymous element is wrapped around this element and any sisters
with a role of 'table-{row,header,footer}-group', 'table-row',
'table-column-group' or 'table-column' that form an uninterrupted
sequence. The anonymous element has a role of <span
class=css>'block'</span> and a model of <span
class=css>'table'</span>.
<p>If the <span class=css>'table'</span> element that is this
element's parent has another child with role <span
class=css>'table-caption'</span> earlier in the document, this
element is treated as if it had a role of <span
class=css>'block'</span> instead. <span class=issue>[In
CSS 2.1 we said this situation was undefined and authors
should not use it...]</span>
<dt>table-row-group
<dd>
<p>The element is a group of rows. If the parent, anonymous or
not, has a model other than <span class=css>'table'</span>, an
anonymous element is wrapped around this element and all its
sister elements with a role of <span
class=css>table-{row,header,footer}-group'</span> that form an
uninterupted sequence. The anonymous element has a role of <span
class=css>'block'</span> and a model of <span
class=css>'table'</span>.
<dt id="table-header-group">table-header-group
<dd>
<p>The element is a group of rows that is displayed at the top of
the table, after any top caption. In paged media, if a page break
occurs in the table, the header group is repeated at the top of
the table after every page break.
<p>If the parent, anonymous or not, has a model other than <span
class=css>'table'</span>, an anonymous element is wrapped around
this element and all its sister elements with a role of <span
class=css>table-{row,header,footer}-group'</span> that form an
uninterupted sequence. The anonymous element has a role of <span
class=css>'block'</span> and a model of <span
class=css>'table'</span>.
<dt>table-footer-group
<dd>
<p>The element is a group of rows that is displayed at the bottom
of the table, before any bottom caption. In paged media, if a page
break occurs in the table, the footer group is repeated at the
bottom of the table before every page break.
<p>If the parent, anonymous or not, has a model other than <span
class=css>'table'</span>, an anonymous element is wrapped around
this element and all its sister elements with a role of <span
class=css>table-{row,header,footer}-group'</span> that form an
uninterupted sequence. The anonymous element has a role of <span
class=css>'block'</span> and a model of <span
class=css>'table'</span>.
<dt>table-column
<dd>
<p>The element creates a column. It's contents are ignored.
<p>If the parent, anonymous or not, has neither the model <span
class=css>'table'</span> nor <span
class=css>'table-column-group'</span>, an anonymous element is
wrapped around this element and any sisters with a role of
<dd>
</dl>
</div>
<p class="issue">An <a
href="http://lists.w3.org/Archives/Public/www-style/2002Mar/0023.html">
idea</a> by Dorothea Salo of Open eBook Forum: some way to scroll a
table and keep the headers and footers on screen, plus a a vertical
analogue. Such "header columns" would stay on the screen during
horizontal scrolling.
<div class=example>
<p>The <a href="http://www.w3.org/TR/CSS2/sample.html">default style sheet for HTML 4.0</a>
in the appendix illustrates the use of these values for HTML 4.0:
<pre>
table { display: table }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }
</pre>
</div>
<p>User agents may ignore these
'display' property values for
HTML table elements, since HTML tables may be rendered using other
algorithms intended for backwards compatible rendering. However, this
is not meant to discourage the use of 'display: table' on other,
non-table elements in HTML.
<p class=issue>Remove the above paragraph?
<h3 id="anonymous-boxes">Anonymous table objects</h3>
<p>Document languages other than HTML may not contain all the elements
in the CSS 2.1 table model. In these cases, the “missing”
elements must be assumed in order for the table model to work. Any
table element will automatically generate necessary anonymous table
objects around itself, consisting of at least three nested objects
corresponding to a 'table'/'inline-table' element, a 'table-row'
element, and a 'table-cell' element. Missing elements generate
<em>anonymous</em> objects (e.g., anonymous
boxes in visual table layout) according to the following rules:
<ol>
<li>If the parent P of a ''table-cell'' box T is not a
''table-row'', a box corresponding to a ''table-row'' will be
generated between P and T. This box will span all consecutive
'table-cell' sibling boxes of T.
<li>If the parent P of a ''table-row'' box T is not a ''table'',
''inline-table'', ''table-header-group'', ''table-footer-group'' or
''table-row-group'' box, a box corresponding to a ''table''
element will be generated between P and T.
If P is an ''inline'' box, then the generated box must be an
''inline-table'' box instead of a ''table'' box.
This box will span all
consecutive sibling boxes of T that require a
''table'' parent: ''table-row'', ''table-row-group'',
''table-header-group'', ''table-footer-group'', ''table-column'',
''table-column-group'', and ''table-caption''. T and T's siblings may
also be anonymous ''table-row'' boxes generated by rule 1.
<li>If the parent P of a ''table-column'' box T is not a ''table'',
''inline-table'', or ''table-column-group'' box, a box
corresponding to a ''table'' element will be generated between P and
T.
If P is an ''inline'' box, then the generated box must be an
''inline-table'' box instead of a ''table'' box.
This box will span all consecutive sibling boxes
of T that require a ''table'' parent: ''table-row'',
''table-row-group'', ''table-header-group'', ''table-footer-group'',
''table-column'', ''table-column-group'', and ''table-caption'', including
any anonymous ''table-row'' boxes generated by rule 1.
<li>If the parent P of a ''table-row-group'' (or ''table-header-group'',
''table-footer-group'', or ''table-column-group'' or ''table-caption'')
box T is not a ''table'' or ''inline-table'', a box
corresponding to a ''table'' element will be generated between P and
T.
If P is an ''inline'' box, then the generated box must be an
''inline-table'' box instead of a ''table'' box.
This box will span all consecutive sibling boxess
of T that require a ''table'' parent: ''table-row'',
''table-row-group'', ''table-header-group'', ''table-footer-group'',
''table-column'', ''table-column-group'', and ''table-caption'', including
any anonymous ''table-row'' boxes generated by rule 1.
<li>If a child T of a ''table'' box (or ''inline-table'') P is not a
''table-row-group'', ''table-header-group'', ''table-footer-group'',
''table-caption'', ''table-column'', ''table-column-group'' or ''table-row''
box, a box corresponding to a ''table-row'' element will be
generated between P and T. This box spans all consecutive
siblings of T that are not ''table-row-group'', ''table-header-group'',
''table-footer-group'', ''table-caption'', ''table-column'',
''table-column-group'' or ''table-row'' boxes.
<li>If a child T of a ''table-row-group'' box (or
''table-header-group'' or ''table-footer-group'') P is not a ''table-row''
box, a box corresponding to a ''table-row'' element will be
generated between P and T. This box spans all consecutive
siblings of T that are not ''table-row'' boxes.
<li>If a child T of a ''table-row'' box P is not a ''table-cell''
box, a box corresponding to a ''table-cell'' element will be
generated between P and T. This box spans all consecutive
siblings of T that are not ''table-cell'' boxes.
</ol>
<div class="example">
<p>In this XML example, a ''table'' element is assumed to contain the
HBOX element:
<pre>
<HBOX>
<VBOX>George</VBOX>
<VBOX>4287</VBOX>
<VBOX>1998</VBOX>
</HBOX>
</pre>
<p>because the associated style sheet is:
<pre>
HBOX { display: table-row }
VBOX { display: table-cell }
</pre>
</div>
<div class="example">
<p>In this example, three ''table-cell'' elements are assumed to contain
the text in the ROWs. Note that the text is further encapsulated in
anonymous inline boxes, as explained in <span
class="issue">[where?]</span>:
<pre class="xml-example">
<STACK>
<ROW>This is the <D>top</D> row.</ROW>
<ROW>This is the <D>middle</D> row.</ROW>
<ROW>This is the <D>bottom</D> row.</ROW>
</STACK>
</pre>
<p>The style sheet is:
<pre>
STACK { display: inline-table }
ROW { display: table-row }
D { display: inline; font-weight: bolder }
</pre>
</div>
<h2 id=columns>Columns</h2>
<p>Table cells may belong to two contexts: rows and columns. However,
in the source document cells are descendants of rows, never of
columns. Nevertheless, some aspects of cells can be influenced by
setting properties on columns.
<p>The following properties apply to column and column-group elements: