cell.adoc 4.88 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
////
Examples for table sections, cell specifiers
////

// tag::styles[]
|===
|Column 1 |Column 2

2*>m|This content is duplicated across two columns (2*) and aligned to the right side of the cell (>).

It's rendered using a monospace font (m).

.3+^.>s|This cell spans 3 rows (`3+`).
The content is centered horizontally (`+^+`), vertically aligned to the bottom of the cell (`.>`), and styled as strong (`s`).
e|This content is italicized (`e`).

m|This content is rendered using a monospace font (m).

s|This content is bold (`s`).
|===
// end::styles[]

// tag::adoc[]
|===
25
|Normal Style |AsciiDoc Style
26

27
|This cell isn't prefixed with an `a`, so the processor doesn't interpret the following lines as an AsciiDoc list.
28
29
30
31
32

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

33
a|This cell is prefixed with an `a`, so the processor interprets the following lines as an AsciiDoc list.
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

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

|This cell isn't prefixed with an `a`, so the processor doesn't interpret the listing block delimiters or the `source` style.

[source,python]
----
import os
print ("%s" %(os.uname()))
----

a|This cell is prefixed with an `a`, so the listing block is processed and rendered according to the `source` style rules.

[source,python]
----
import os
print "%s" %(os.uname())
----

|===
// end::adoc[]

// tag::span-cols[]
|===
|Column 1, header row |Column 2, header row |Column 3, header row |Column 4, header row

3+|This cell spans columns 1, 2, and 3 because its specifier contains a span of `3+`
|Cell in column 4, row 2

|Cell in column 1, row 3
|Cell in column 2, row 3
|Cell in column 3, row 3
|Cell in column 4, row 3
|===
// end::span-cols[]

// tag::span-rows[]
|===
|Column 1, header row |Column 2, header row

.2+|This cell spans rows 2 and 3 because its specifier contains a span of `.2+`
|Cell in column 2, row 2

|Cell in column 2, row 3

|Cell in column 1, row 4
|Cell in column 2, row 4
|===
// end::span-rows[]

// tag::span-block[]
|===
|Column 1, header row |Column 2, header row |Column 3, header row |Column 4, header row

|Cell in column 1, row 2
2.3+|This cell spans columns 2 and 3 and rows 2, 3, and 4 because its specifier contains a span of `2.3+`
|Cell in column 4, row 2

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

|Cell in column 1, row 4
|Cell in column 4, row 4
|===
// end::span-block[]

// tag::clone[]
|===
|Column 1, header row |Column 2, header row |Column 3, header row

2*|This cell is duplicated in columns 1 and 2 because its specifier contains a duplication of `2*`
|Cell in column 3, row 2

|Cell in column 1, row 3
|Cell in column 2, row 3
3*e|This cell specifier contains the duplication `3*` and style operator `e`.

The cell's text is italicized and duplicated in column 3, row 3 and columns 1 and 2 on row 4.

|Cell in column 3, row 4
|===
// end::clone[]

119
120
121
122
123
124
125
126
127
128
129
// in qr
// tag::b-spec[]
[cols="e,m,^,>s",width="25%"]
|===
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10
|===
// end::b-spec[]

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
== THESE ARE THE LEGACY EXAMPLES THAT MAY NO LONGER BE IN USE

// tag::3dup[]
|===

|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

|===
// end::3dup[]

// tag::3span[]
|===

|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

|===
// end::3span[]

// tag::2span-r[]
|===

|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

|===
// end::2span-r[]

// tag::span-cr[]
|===

|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
|===
// end::span-cr[]

// tag::cell-align[]
[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.

|===
// end::cell-align[]



210

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230

// tag::cell-src[]
|===
|Source Code 1 |Source Code 2

a|
[source,python]
----
import os
print "%s" %(os.uname())
----

a|
[source,python]
----
import os
print ("%s" %(os.uname()))
----
|===
// end::cell-src[]