summaryrefslogtreecommitdiffstats
path: root/t/fmt/asciidoc/TablesCells.adoc
blob: dbd1740cdf58087c3baad59d0ee437c608522b8a (plain)
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
Tables with Cells translated
============================

Examples taken from asciidoctor table guide

.Simple table
|===
| Cell in column 1, row 1 | Cell in column 2, row 1
| Cell in column 1, row 2 | Cell in column 2, row 2
| Cell in column 1, row 3 | Cell in column 2, row 3
|===

.No space around column separator
|===
|Cell in column 1, row 1|Cell in column 2, row 1
|===

.Cells on each line
[cols="3*"]
|===
|Cell in column 1, row 1
|Cell in column 2, row 1
|Cell in column 3, row 1

|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 3, row 2
|===

.Cell duplicated
|===
|Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1
3*|Same cell content in columns 1, 2, and 3
|Cell in column 1, row 3
|Cell in column 2, row 3
|Cell in column 3, row 3
|===

.Cell span
|===

|Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1

3+|Content in a single cell that spans columns 1, 2, and 3

|Cell in column 1, row 3
|Cell in column 2, row 3
|Cell in column 3, row 3

|===

.Cell span in rows
|===

|Cell in column 1, row 1 |Cell in column 2, row 1 |Cell in column 3, row 1

.2+|Content in a single cell that spans rows 2 and 3
|Cell in column 2, row 2
|Cell in column 3, row 2

|Cell in column 2, row 3
|Cell in column 3, row 3

|===

.Cell span in columns and rows
|===

|Column 1, row 1 |Column 2, row 1 |Column 3, row 1 |Column 4, row 1

|Column 1, row 2
2.3+|Content in a single cell that spans over rows and columns
|Column 4, row 2

|Column 1, row 3
|Column 4, row 3

|Column 1, row 4
|Column 4, row 4
|===

.Cells aligned horizontally, vertically, and across a span of three columns
[cols="3"]
|===
^|Prefix the `{vbar}` with `{caret}` to center content horizontally
<|Prefix the `{vbar}` with `<` to align the content to the left horizontally
>|Prefix the `{vbar}` with `>` to align the content to the right horizontally

.^|Prefix the `{vbar}` with a `.` and `{caret}` to center the content in the cell vertically
.<|Prefix the `{vbar}` with a `.` and `<` to align the content to the top of the cell
.>|Prefix the `{vbar}` with a `.` and `>` to align the content to the bottom of the cell

3+^.^|This content spans three columns (`3{plus}`) and is centered horizontally (`{caret}`) and vertically (`.{caret}`) within the cell.

|===

.Building a variety of cell specifiers
|===

2*>m|This content is duplicated across two columns.

It is aligned right horizontally.

And it is monospaced.

.3+^.>s|This cell spans 3 rows. The content is centered horizontally, aligned to the bottom of the cell, and strong.
e|This content is emphasized.

.^l|This content is aligned to the top of the cell and literal.

v|This cell contains a verse
that may one day expound on the
wonders of tables in an
epic sonnet.

|===

.Cells with Asciidoc in them
[cols="2"]
|===

a|This cell is prefixed with an `a`, so the processor interprets the following lines as an AsciiDoc list.

* List item 1
* List item 2
* List item 3
|This cell *is not* prefixed with an `a`, so the processor does not interpret the following lines as an AsciiDoc list.

* List item 1
* List item 2
* List item 3

a|This cell is prefixed with an `a`, so the processor honors the `lead` style on the following paragraph.

[.lead]
I am a paragraph styled with the lead attribute.
|This cell *is not* prefixed with an `a`, so the processor does not honor the `lead` style on the following paragraph.

[.lead]
I am a paragraph styled with the lead attribute.
|===

[format="csv",width="60%",cols="2"]
[frame="topbot",grid="none"]
[options="header"]
|===
iocontrol.0 pin  ,motion pin
tool-prepare,digital-out-00
tool-prepared,digital-in-00
tool-change,digital-out-01
tool-changed,digital-in-01
tool-prep-number,analog-out-00
tool-prep-pocket,analog-out-01
tool-number,analog-out-02
|===

.Empty cells
|===
|0|
||
|===