tables.adoc 8.29 KB
Newer Older
heywon.choi's avatar
heywon.choi committed
1
= Tables
heywon.choi's avatar
heywon.choi committed
2 3
Gildong Hong <email1@bwg.com>
:description: The document's description. This document is about the table sample.
heywon.choi's avatar
heywon.choi committed
4 5
include::../attributes/common_attrs.adoc[]
include::../attributes/dir_attrs.adoc[]
heywon.choi's avatar
heywon.choi committed
6 7 8 9 10 11 12 13 14

[abstract]
.문서개요
--
This document has a header that specifies the {doctitle}.
This document is about the table.
--

== 기본
heywon.choi's avatar
heywon.choi committed
15 16
[cols="1a"]
|===
17
....
heywon.choi's avatar
heywon.choi committed
18 19 20 21 22 23 24 25 26 27 28
.테이블 제목
[cols=""]
\|===
\|헤더1열 \|헤더2열

\|1행1열
\|1행2열

\|2행1열
\|2행2열
\|===
29
....
heywon.choi's avatar
heywon.choi committed
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
|===

* 결과
+
.테이블 제목
[cols=""]
|===
|헤더1열 |헤더2열

|1행 1열
|1행 2열

|2행 1열
|2행 2열
|===


== 열
=== 열 너비
[cols="1,9a"]
|===
|[cols="1,1,1,1"]
\|=== 
|
* 새 줄에서 속성 목록을 만듭니다. 열 속성 [cols=""]
* 열은 쉼표로 구분하고 목록의 각 항목을 열 지정자라고 합니다.
* 열 지정자는 열과 해당 열에 할당된 너비, 맞춤 및 스타일 속성을 나타냅니다.
* 각 열 지정자가 동일한 숫자(이 경우 정수)인 경우 모든 열의 너비가 동일합니다.

|[cols="4*"]
\|===
|
* 동일한 너비, 가로 맞춤, 세로 맞춤 및 내용 스타일을 표의 여러 연속 열에 적용할 땐 **열 승수**를 사용합니다.
* 승수는 정수(n)와 별표(*)로 구성됩니다.
** 정수(n): 테이블에 추가될 연속 열의 수
** 별표(*): 승수 연산자라고 하며 정수 바로 뒤에 배치
** ex) [cols="5,1,1,1"] => [cols="5,3*"]

|[cols="25,25,25,25"]
\|===
|
* 열 너비는 1%와 100%사이의 백분율을 사용하여 할당할 수도 있습니다. 
백분율 기호(%)는 생략합니다.
** ex) [cols="15%,30%,55%"] => [cols="15,30,55"]
|===

=== 열 정렬
정렬 연산자는 열 지정자에 적용되고 cols 속성에 할당됩니다.

.가로 정렬
[cols="^1,1,3a"]
|===
|<
|왼쪽 정렬
(기본)
.3+|
* 가로 정렬 연산자는 세로 정렬 연산자(있는 경우) 앞과 열 너비(있는 경우) 앞에 입력됩니다. 
** [cols="2,##^##1"] : 두번째 열 가로 가운데 정렬
** [cols="##>##.^1,2"] : 첫번째 열 가로 오른쪽 정렬, 세로 가운데 정렬
* 승수(*)를 사용 시 가로 정렬 연산자가 승수 연산자 바로 뒤에 배치됩니다.
** [cols="3*##>##"] : 모든 열 가로 오른쪽 정렬

|>
|오른쪽 정렬

|^
|가운데 정렬
|===

.세로 정렬
[cols="^1,1,3a"]
|===
|.<
|위쪽 정렬
(기본)
.3+|
* 세로 정렬 연산자는 가로 정렬 연산자(있는 경우) 바로 뒤와 열 너비(있는 경우) 앞에 입력됩니다.
** [cols="2,##.^##1"] : 두번째 열 세로 가운데 정렬
** [cols=">##.^##1,2"] : 첫번째 열 가로 오른쪽 정렬, 세로 가운데 정렬
* 승수(*)를 사용 시 세로 정렬 연산자가 승수 연산자 바로 뒤에 배치됩니다.
** [cols="3*##.>##"] : 모든 열 세로 아래쪽 정렬

|.>
|아래쪽 정렬

|.^
|가운데 정렬
|===

=== 열 서식
[cols="2,^2,5"]
|===
|서식 |연산자 |설명

|AsciiDoc
|a
a|* 블록 요소(목록, 구분된 블록 및 블록 매크로) 지원

|Default(기본)
|d
d|단락에서 허용되는 모든 태그(예: 인라인 서식, 인라인 매크로) 지원

|Header
|h
h|머리글 의미와 스타일을 텍스트와 셀 테두리에 적용

|Literal
|l
l|리터럴 블록 안에 있는 것처럼 처리

|Monospace
|m
m|텍스트 고정 폭 글꼴을 사용하여 렌더링

|기울임
|e
e|텍스트 기울임꼴로 표시

|굵게
|s
s|텍스트 굵게 표시
|===

* 서식 연산자는 항상 열의 지정자 또는 승수의 마지막 위치에 배치
** [cols=">1##e##,.^3##s##"]
** [cols="3*.>##m##"]
* 특정 셀에만 서식을 지정할 때는 셀 구분자 세로 막대(|) 앞에 서식 연산자 지정
** a| : 블록 요소 지원
** e| : 텍스트 기울임꼴

== 행
[cols="1a"]
|===
----
.A table with a title
[cols="1,1"]
\|===
\|Cell in column 1, header row \|Cell in column 2, header row <1>
<2>
\|Cell in column 1, row 1 <3>
\|Cell in column 2, row 1 <4>
<5>
\|Cell in column 1, row 2
\|Cell in column 2, row 2
\|===
----
|===


<1> 여는 구분 기호(|===) 바로 뒤의 줄에서 첫 번째 행의 모든 셀을 한 줄에 입력합니다.
+
** 첫 번째 행을 머리글 행으로 처리하지 않으려는 경우 여는 구분 기호(|===) 바로 뒤에 빈 줄을 삽입합니다.
<2> 머리글 행 바로 뒤의 줄은 비워 둡니다.
<3> 새 셀을 만들려면 Shift+|. 세로 막대(|) 뒤에 해당 셀에 표시할 내용을 입력합니다.
<4> 새 줄에서 다른 셀을 입력합니다.
<5> 행은 하나 이상의 빈 줄로 구분됩니다.

* 결과
+
.A table with a title
heywon.choi's avatar
heywon.choi committed
190 191 192 193
[cols="1,1"]
|===
|Cell in column 1, header row |Cell in column 2, header row

heywon.choi's avatar
heywon.choi committed
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
|Cell in column 1, row 2
|Cell in column 2, row 2

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

== 셀
* 셀 지정자 순서
|===
<factor><span(+) 또는 중복(*)연산자><가로정렬연산자><세로정렬연산자><서식연산자>\|<셀내용>
|===
=== 셀 병합
* 열 병합
열 범위 인수(`n`)와 범위 연산자(`+`)를 입력합니다. 예) 2+
* 행 병합
행 범위 인수(`.n`)와 범위 연산자(`+`)를 입력합니다. 예) .2+

[cols="1a"]
|===
----
[%header,cols="4*"]
\|===
\|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
heywon.choi's avatar
heywon.choi committed
229

heywon.choi's avatar
heywon.choi committed
230 231
\|Cell in column 1, row 3
\|Cell in column 4, row 3
heywon.choi's avatar
heywon.choi committed
232

heywon.choi's avatar
heywon.choi committed
233 234 235 236
\|Cell in column 1, row 4
\|Cell in column 4, row 4
\|===
----
heywon.choi's avatar
heywon.choi committed
237 238
|===

heywon.choi's avatar
heywon.choi committed
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
* 결과
+
[%header,cols="4*"]
|===
|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
|===

=== 셀 정렬
셀의 내용을 가로로 가운데에 맞추려면 셀의 구분 기호(|) 앞에 연산자를 배치합니다.
[cols="1a"]
|===
----
\|===
\|column 1 \|column 2

.2+>.>\|This cell spans two rows(`.2+`), and its content is aligned to the right(`>`) and the bottom(`.>`).
2+^\|This cell spans two columns(`2+`), and its content is horizontally centered(`^`).

2*\|This content is duplicated in two adjacent columns(`2*`). It's content is aligned to the left of the cell by default.
\|===
----
|===

* 결과
+
|===
|column 1 |column 2 |column 3

.2+>.>|This cell spans two rows(`.2+`), and its content is aligned to the right (`>`) and the bottom(`.>`).
2+^|This cell spans two columns(`2+`), and its content is horizontally centered(`^`).

2*|This content is duplicated in two adjacent columns(`2*`). It's content is aligned to the left of the cell by default.
|===



=== 셀 서식
서식 연산자는 항상 셀 지정자의 마지막에 입력됩니다.
셀의 구분 기호(|)와 연산자 사이에 공백을 삽입하지 마세요.
[cols="1a"]
|===
----
\|===
\|Column 1 \|Column 2

.4+^.>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`).

a\|This cell supports block elements (`a`).
* List item 1
* List item 2
[source,python]
----
import os
print "%s" %(os.uname())
----
\|===
----
|===

* 결과
+
|===
|Column 1 |Column 2

.4+^.>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`).

a|This cell supports block elements (`a`).
* List item 1
* List item 2
[source,python]
----
import os
print "%s" %(os.uname())
----
|===

== 중첩
AsciiDoc 표 서식(a)로 표시된 표 셀은 일반 블록 내용 외에도 중첩 표를 지원합니다.
중첩 표의 기본 셀 구분 기호는 !===, ! 입니다.
[cols="1a"]
|===
----
[cols="1,2a"]
\|===
\| Col 1 \| Col 2

\| Cell 1.1
\| Cell 1.2

\| Cell 2.1
\| Cell 2.2

[cols="2,1"]
!===
! Col1 ! Col2

! C11
! C12
!===

\|===
----
|===

* 결과
+
[cols="1,2a"]
|===
| Col 1 | Col 2

| Cell 1.1
| Cell 1.2

| Cell 2.1
| Cell 2.2

[cols="2,1"]
!===
! Col1 ! Col2

! C11
! C12
!===

heywon.choi's avatar
heywon.choi committed
392
|===