forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
3960 lines (3028 loc) · 141 KB
/
Overview.html
File metadata and controls
3960 lines (3028 loc) · 141 KB
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 profile="http://dublincore.org/documents/2008/08/04/dc-html/ ">
<meta charset=utf8>
<title>CSS3 Tables Module</title>
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=dcterms.rights>
<meta content="CSS3 Tables Module" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2014-02-03 name=dcterms.date>
<meta content="Bert Bos" name=dcterms.creator>
<meta content="[editor name" name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://dev.w3.org/csswg/css3-tables/"
name=dcterms.identifier>
<link href="../default.css" rel=stylesheet type="text/css">
<style type="text/css">
/* Just in case an incorrect max-width occurs in default.css */
body {max-width: none !important}
</style>
<link href="https://www.w3.org/StyleSheets/TR/W3C-ED" rel=stylesheet
type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="https://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS3 Tables Module</h1>
<h2 class="no-num no-toc">Editor's Draft 3 February 2014</h2>
<dl>
<dt>This version:
<dd><a
href="http://dev.w3.org/csswg/css3-tables/">http://www.w3.org/2014/MO-css3-tables-20140203</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-tables/">http://www.w3.org/TR/css3-tables/</a>
<dt>Previous version:
<dd><a
href="[http://www.w3.org/PreviousVersionURI]">[http://www.w3.org/PreviousVersionURI]</a>
<dt>Feedback:
<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
href="http://lists.w3.org/Archives/Public/www-style/"
rel=discussion>archives</a>)
<dt>Editors:
<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>[editor name, affiliation (opt.), email address (opt.)]
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2014 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><abbr
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>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 <a
href="#ref-CSS3INTRO" rel=biblioentry>[CSS3INTRO]<!--{{CSS3INTRO}}--></a>
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 class="no-num no-toc" id=status>Status of this document</h2>
<details class=annoying-warning open=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><!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-tables%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the text
“css3-tables†in the subject, preferably like this:
“[<!---->css3-tables<!---->] <em>…summary of comment…</em>â€
<p>This document was produced by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
the <a href="http://www.w3.org/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<!--end-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>
<!--begin-toc-->
<ul class=toc>
<li><a href="#dependencies-on-other-modules"><span class=secno>1.
</span>Dependencies on other modules</a>
<li><a href="#the-tab-properties-tabs-and-leaders"><span class=secno>2.
</span>The ‘<code class=property>tab</code>’ properties: tabs and
leaders</a>
<li><a href="#introduction-to-tables"><span class=secno>3.
</span>Introduction to tables</a>
<li><a href="#the-css-table-model"><span class=secno>4. </span>The CSS
table model</a>
<ul class=toc>
<li><a href="#anonymous-boxes"><span class=secno>4.1. </span>Anonymous
table objects</a>
</ul>
<li><a href="#columns"><span class=secno>5. </span>Columns</a>
<li><a href="#model"><span class=secno>6. </span>Tables in the visual
formatting model</a>
<ul class=toc>
<li><a href="#caption-position-and-alignment"><span class=secno>6.1.
</span>Caption position and alignment</a>
</ul>
<li><a href="#Visual"><span class=secno>7. </span>Visual layout of table
contents</a>
<ul class=toc>
<li><a href="#table-layers"><span class=secno>7.1. </span>Table layers
and transparency</a>
<li><a href="#width-layout"><span class=secno>7.2. </span>Table width
algorithms: the ‘<code class=property>table-layout</code>’
property</a>
<ul class=toc>
<li><a href="#fixed-table-layout"><span class=secno>7.2.1.
</span>Fixed table layout</a>
<li><a href="#auto-table-layout"><span class=secno>7.2.2.
</span>Automatic table layout</a>
</ul>
<li><a href="#height-layout"><span class=secno>7.3. </span>Table height
algorithms</a>
<li><a href="#column-alignment"><span class=secno>7.4. </span>Horizontal
alignment in a column</a>
<li><a href="#dynamic-effects"><span class=secno>7.5. </span>Dynamic row
and column effects</a>
</ul>
<li><a href="#borders"><span class=secno>8. </span>Borders</a>
<ul class=toc>
<li><a href="#separated-borders"><span class=secno>8.1. </span>The
separated borders model</a>
<ul class=toc>
<li><a href="#empty-cells"><span class=secno>8.1.1. </span>Borders
around empty cells: the ‘<code class=property>empty-cells</code>’
property</a>
</ul>
<li><a href="#collapsing-borders"><span class=secno>8.2. </span>The
collapsing border model</a>
<ul class=toc>
<li><a href="#border-conflict-resolution"><span class=secno>8.2.1.
</span>Border conflict resolution</a>
<li><a href="#collapsed-bg"><span class=secno>8.2.2.
</span>Backgrounds in the collapsed border model</a>
</ul>
<li><a href="#border-styles"><span class=secno>8.3. </span>Border
styles</a>
</ul>
<li><a href="#the-table-column-span-and-table-row-span"><span
class=secno>9. </span>The ‘<code
class=property>table-column-span</code>’ and ‘<code
class=property>table-row-span</code>’ properties</a>
<li><a href="#aligning-tables-table-baseline-property"><span
class=secno>10. </span>Aligning tables: ‘<code
class=property>table-baseline</code>’ property</a>
<li><a href="#audio-rendering-of-tables"><span class=secno>11.
</span>Audio rendering of tables</a>
<ul class=toc>
<li><a href="#speak-headers"><span class=secno>11.1. </span>Speaking
headers: the ‘<code class=property>speak-header</code>’
property</a>
</ul>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<hr>
<h2 id=dependencies-on-other-modules><span class=secno>1.
</span>Dependencies on other modules</h2>
<p>This CSS3 module depends on the following other CSS3 modules:
<ul>
<li>CSS3 Box Model <a href="#ref-CSS3BOX"
rel=biblioentry>[CSS3BOX]<!--{{!CSS3BOX}}--></a>
<li>CSS3 Syntax Module <a href="#ref-CSS3SYN"
rel=biblioentry>[CSS3SYN]<!--{{!CSS3SYN}}--></a>
<li>CSS3 Values and Units Module <a href="#ref-CSS3VAL"
rel=biblioentry>[CSS3VAL]<!--{{!CSS3VAL}}--></a>
<li>[module]
</ul>
<h2 id=the-tab-properties-tabs-and-leaders><span class=secno>2. </span>The
‘<a href="#tab"><code class=property>tab</code></a>’ 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? ‘<code class=css>margin-left: 25%
fixed</code>’ instead of ‘<code class=css>tab: 25% left</code>’?]
<p class=issue>Håkon will write a proposal for a ‘<code
class=css>leader(<string>)</code>’ notation that can be put in the
‘<code class=property>content</code>’ property, inside ‘<code
class=css>::after</code>’ and ‘<code class=css>::before</code>’,
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 <a
href="#ref-CSS3GCPM" rel=biblioentry>[CSS3GCPM]<!--{{CSS3GCPM}}--></a>.
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=tab-position>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 ‘<code
class=property>horizontal</code>’, otherwise height
</table>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=tab-align>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 id=tab-leaders>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 id=tab-leaders-alignment>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 id=tab>tab</dfn>
<tr>
<td><em>Value:</em>
<td>[ <‘<a href="#tab-position"><code
class=property>tab-position</code></a>’> || <‘<a
href="#tab-align"><code class=property>tab-align</code></a>’> ] [
/ [ <‘<a href="#tab-leaders"><code
class=property>tab-leaders</code></a>’> || <‘<a
href="#tab-leaders-alignment"><code
class=property>tab-leaders-alignment</code></a>’> ] ]?
<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 <a class=property href="#tab">‘<code
class=property>tab</code>’</a> property. The space that creates before
the element can be filled with <dfn id=leaders>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 alt="[image]" src=tabs.png>
<p class=caption>Possible rendering of a text with tabs and leaders
</div>
</div>
<p>The <a class=property href="#tab-position">‘<code
class=property>tab-position</code>’</a> and <a class=property
href="#tab-align">‘<code class=property>tab-align</code>’</a>
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 <a class=property href="#tab-position">‘<code
class=property>tab-position</code>’</a> 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 ‘<code class=css>0</code>’ means the
start of the line. Use 100% to refer to the end of the line.
<p><a class=property href="#tab-align">‘<code
class=property>Tab-align</code>’</a> specifies how the element is
aligned to the alignment point:
<dl>
<dt>‘<a href="#none"><code class=property>none</code></a>’
<dd>The element is not aligned to any alignment point and is put
immediately after the previous element, with no intervening leaders.
<dt>‘<code class=property>left</code>’, ‘<a href="#top0"><code
class=property>top</code></a>’
<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 <a
class=property href="#direction">‘<code
class=property>direction</code>’</a> of the containing block: the
first box in the case of <span class=css>‘<code
class=property>ltr</code>’</span>, the last box in the case of <span
class=css>‘<code class=property>rtl</code>’</span>.
<dt>‘<code class=property>right</code>’, ‘<a href="#bottom0"><code
class=property>bottom</code></a>’
<dd>The right <em>margin edge</em> (or bottom, if vertical) is at the
given position. If the <a class=property href="#direction">‘<code
class=property>direction</code>’</a> of the containing block is <span
class=css>‘<code class=property>ltr</code>’</span>, the element's
last box is aligned, otherwise the first box.
<dt>‘<code class=property>center</code>’
<dd>The element is centered around the given position. If a line break
occurs inside the element, the element might not be centered exactly.
<dt><var><string></var>
<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.
</dl>
<p class=issue>[Do we need ‘<code class=property>start</code>’ and
‘<code class=property>end</code>’ keywords that dynamically resolve to
‘<code class=property>left</code>’ or ‘<code
class=property>right</code>’ 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 <a class=property href="#tab-leaders">‘<code
class=property>tab-leaders</code>’</a> 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 <a class=property href="#tab-leaders-alignment">‘<code
class=property>tab-leaders-alignment</code>’</a> have the following
meaning:
<dl>
<dt>‘<code class=property>centered</code>’
<dd>If the space for the leaders is not a whole number of copies of the <a
class=property href="#tab-leaders">‘<code
class=property>tab-leaders</code>’</a> 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.)
<dt>‘<code class=property>distributed</code>’
<dd>Like for <span class=css>‘<code
class=property>centered</code>’</span>, but the extra whitespace is
inserted in equal amounts before the first, after the last and between
the strings.
<dt>‘<code class=property>aligned</code>’
<dd>The <a class=property href="#tab-leaders">‘<code
class=property>tab-leaders</code>’</a> 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 ‘<code class=property>aligned</code>’
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>
</dl>
<p>The <a class=property href="#tab">‘<code
class=property>tab</code>’</a> 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 <a class=property
href="#tab">‘<code class=property>tab</code>’</a>: if leaders are
specified, they must be separated from the position & alignment with a
slash.
<p class=note>Note that <span class=css>‘<code class=css>tab: 2em /
"."</code>’</span> is a valid, and occasionally useful declaration, but
by itself does not cause any leaders to appear, because it implicitly sets
<a class=property href="#tab-align">‘<code
class=property>tab-align</code>’</a> to <a class=css
href="#none">‘<code class=property>none</code>’</a>.
<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 ‘<code class=css>arrow-leader
(for a stretchy arrow) or </code>’double-arrow-leader', or can they be
made from existing characters? Or should ‘<a href="#tab-leaders"><code
class=property>tab-leaders</code></a>’ accept up to 3 strings, e.g.,
"\2190" "\2500" "\2192" ("â†" "─" "→"), for start, middle and end of
the leaders?]
<h2 id=introduction-to-tables><span class=secno>3. </span>Introduction to
tables</h2>
<p class=issue>What happens with tables in vertical text (‘<code
class=css>writing-mode: tb-rl</code>’ etc.)? Are tables rotated or not?
Currently, the specification says rows are horizontal and the only
influence is from ‘<a href="#direction"><code
class=property>direction</code></a>’, 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 <a
href="#table"><code class=html>table</code></a> element in HTML, the <a
class=property href="#table">‘<code class=property>table</code>’</a>
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 <a href="#table"><code
class=html>TABLE</code></a> 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 id=map
title="mapping elements to table parts">"map"</span> document language
elements to table elements via the <a class=propinst-display
href="#display">‘<code class=property>display</code>’</a> 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:
<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 <a class=index-def
href="#table-element" id=table-element0 title="table element"><dfn
id=table-element>table element</dfn></a> refers to any element involved in
the creation of a table. An <span class=index-def
id="âinternalâ-table-element"
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 id=the-css-table-model><span class=secno>4. </span>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 ‘<a href="#display"><code
class=property>display</code></a>’ property. The following ‘<a
href="#display"><code class=property>display</code></a>’ values assign
table formatting rules to an arbitrary element:
<dl>
<dt><dfn id=table>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 id=inline-table>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 id=table-row>table-row</dfn> (In HTML: TR)
<dd>Specifies that an element is a row of cells.
<dt><dfn id=table-row-group>table-row-group</dfn> (In HTML: TBODY)
<dd>Specifies that an element groups one or more rows.
<dt><dfn id=table-header-group0>table-header-group</dfn> (In HTML: THEAD)
<dd>Like ‘<a href="#table-row-group"><code
class=property>table-row-group</code></a>’, 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
‘<code class=css>display: table-header-group</code>’, only the first
is rendered as a header; the others are treated as if they had ‘<code
class=css>display: table-row-group</code>’.
<dt><dfn id=table-footer-group>table-footer-group</dfn> (In HTML: TFOOT)
<dd>Like ‘<a href="#table-row-group"><code
class=property>table-row-group</code></a>’, 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
‘<code class=css>display: table-footer-group</code>’, only the first
is rendered as a footer; the others are treated as if they had ‘<code
class=css>display: table-row-group</code>’.
<dt><dfn id=table-column>table-column</dfn> (In HTML: COL)
<dd>Specifies that an element describes a column of cells.
<dt><dfn id=table-column-group>table-column-group</dfn> (In HTML:
COLGROUP)
<dd>Specifies that an element groups one or more columns.
<dt><dfn id=table-cell>table-cell</dfn> (In HTML: TD, TH)
<dd>Specifies that an element represents a table cell.
<dt><dfn id=table-caption>table-caption</dfn> (In HTML: CAPTION)
<dd>Specifies a caption for the table. All elements with ‘<code
class=css>display: table-caption</code>’ must be rendered, as described
in <a href="#model">section [??].</a>
</dl>
<p>Replaced elements with these ‘<a href="#display"><code
class=property>display</code></a>’ values are treated as their given
display types during layout. For example, an image that is set to ‘<code
class=css>display: table-cell</code>’ will fill the available cell
space, and its dimensions might contribute towards the table sizing
algorithms, as with an ordinary cell.
<p>Elements with ‘<a href="#display"><code
class=property>display</code></a>’ set to ‘<a
href="#table-column"><code class=property>table-column</code></a>’ or
‘<a href="#table-column-group"><code
class=property>table-column-group</code></a>’ are not rendered (exactly
as if they had ‘<code class=css>display: none</code>’), 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 ‘<code
class=property>display-model</code>’ and ‘<code
class=property>display-role</code>’:
<p>The values of <span class=property>‘<code
class=property>display-model</code>’</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>‘<code
class=property>display-role</code>’</span> of <a class=css
href="#none">‘<code class=property>none</code>’</a> 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>‘<code
class=css>table-{row,header,footer}-group</code>’</span> or <a
class=css href="#table-caption">‘<code
class=property>table-caption</code>’</a> is wrapped in an anonymous
element with role and model both set to <a class=css
href="#table-row-group">‘<code
class=property>table-row-group</code>’</a>.
<p>The resulting set of children is laid out as a stack of rows from top
to bottom, with at the top any <a class=css
href="#table-header-group0">‘<code
class=property>table-header-group</code>’</a> child, then the <a
class=css href="#table-row-group">‘<code
class=property>table-row-group</code>’</a> children, in the order of
the document, and finally any <a class=css
href="#table-footer-group">‘<code
class=property>table-footer-group</code>’</a> 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
<a class=css href="#table-row">‘<code
class=property>table-row</code>’</a> is wrapped in an anonymous
element with role set to <a class=css href="#table-row">‘<code
class=property>table-row</code>’</a> and model set to <span
class=css>‘<code class=property>block-inside</code>’</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 <a