WikiPAdia:표
WikiPAdia, 우리 모두의 백과사전.
미디어위키는 [HTML]이나 [XHTML]의 table을 쓸 수도 있지만 보다 편하게 표를 만들 수 있는 방법을 제공합니다.
- 전체 표는 "
{|표 옵션 "으로 시작해서 "|}"로 끝납니다. - "
{|" 다음에 "|+제목 "으로 시작하는 줄을 넣어 표 제목을 달 수도 있습니다. - 표의 행은 "
|-표 옵션 "으로 시작합니다. - 표의 칸 은 "| 값 " 또는 "| 칸 옵션 | 값 " 식으로 넣습니다.
- 표의 머리글 칸은 "|" 대신 "!"을 사용하여 구분합니다. "!"로 시작하는 칸은 대개 굵은 글씨로 표시됩니다.
표 옵션과 칸 옵션은 HTML 문법과 동일합니다. [1]
Contents |
[edit]
예
[edit]
간단한 예
{|
| Cell 1, row 1
| Cell 2, row 1
|-
| Cell 1, row 2
| Cell 2, row 2
|}
와
{|
| Cell 1, row 1 || Cell 2, row 1
|-
| Cell 1, row 2 || Cell 2, row 2
|}
은 모두 다음과 같이 보입니다.
| Cell 1, row 1 | Cell 2, row 1 |
| Cell 1, row 2 | Cell 2, row 2 |
[edit]
곱셈 표
[edit]
소스
{| border="1" cellpadding="2"
|+곱셈 표
|-
! × !! 1 !! 2 !! 3
|-
! 1
| 1 || 2 || 3
|-
! 2
| 2 || 4 || 6
|-
! 3
| 3 || 6 || 9
|-
! 4
| 4 || 8 || 12
|-
! 5
| 5 || 10 || 15
|}
[edit]
결과
곱셈 표 × 1 2 3 1 1 2 3 2 2 4 6 3 3 6 9 4 4 8 12 5 5 10 15
[edit]
색
글자와 배경의 색은 다음 두 가지 방법으로 넣을 수 있습니다:
{|
| bgcolor=red | <font color=white> abc
| def
| style="background:red; color:white" | ghi
| jkl
|}
이라고 하면 다음처럼 보입니다.
| abc | def | ghi | jkl |
표 전체, 또는 표의 각 줄에 대해서 색을 지정할 수 있습니다:
{| style="background:yellow; color:green"
|-
| abc
| def
| ghi
|- style="background:red; color:white"
| jkl
| mno
| pqr
|-
| stu
| style="background:silver" | vwx
| yz
|}
이라고 하면 아래와 같이 표시됩니다.
| abc | def | ghi |
| jkl | mno | pqr |
| stu | vwx | yz |
HTML에서 지정된 웹 색상이나 16진수 값으로 색을 지정할 수 있습니다.
| black | #000000 | silver | #c0c0c0 | maroon | #800000 | red | #ff0000 | |||
| navy | #000080 | blue | #0000ff | purple | #800080 | fuchsia | #ff00ff | |||
| green | #008000 | lime | #00ff00 | olive | #808000 | Yellow | #ffff00 | |||
| teal | #008080 | aqua | #00ffff | gray | #808080 | white | #ffffff |
[edit]
폭, 높이
표 전체의 폭과 높이, 또는 각 줄의 높이, 각 컬럼의 폭을 지정할 수 있습니다. 결과는 브라우저에 따라 다르게 보일 수 있습니다.
{| style="width:400px; height:200px" border="1"
|-
| abc
| def
| ghi
|- style="height:100px"
| jkl
| style="width:200px" |mno
| pqr
|-
| stu
| vwx
| yz
|}
아래와 같이 보입니다.
| abc | def | ghi |
| jkl | mno | pqr |
| stu | vwx | yz |
[edit]
위치
표의 위치나 표 안에서 각 칸의 위치를 지정할 수도 있습니다.
[edit]
이것저것 넣기
색, 폭 지정, 위치 지정 등을 모두 다 지정할 수 있습니다. 하지만 이렇게 복잡한 표를 만든다면 다른 사람이 편집하기 어렵게 됩니다.
[edit]
소스
{| border="1" cellpadding="5" cellspacing="0" align="center"
|+'''An example table'''
|-
! style="background:#efefef;" | First header
! colspan="2" style="background:#ffdead;" | Second header
|-
| upper left
|
| rowspan=2 style="border-bottom:3px solid grey;" valign="top" |
right side
|-
| style="border-bottom:3px solid grey;" | lower left
| style="border-bottom:3px solid grey;" | lower middle
|-
| colspan="3" align="center" |
{| border="0"
|+''A table in a table''
|-
| align="center" width="150px" | [[Image:wiki.png]]
| align="center" width="150px" | [[Image:wiki.png]]
|-
| align="center" colspan="2" style="border-top:1px solid red; border-right:1px
solid red; border-bottom:2px solid red; border-left:1px solid red;" |
Two Wikipedia logos
|}
|}
[edit]
결과
An example table First header Second header upper left right side
lower left lower middle
A table in a table 그림:Wiki.png 그림:Wiki.png Two Wikipedia logos
[edit]
위치 지정 예
{| align=right border=1
| Cell 1, row 1
|rowspan=2| Cell 2, row 1 (and 2)
| Cell 3, row 1
|-
| Cell 1, row 2
| Cell 3, row 2
|}
| Cell 1, row 1 | Cell 2, row 1 (and 2) | Cell 3, row 1 |
| Cell 1, row 2 | Cell 3, row 2 |
오른 쪽에 표시된 표를 볼 수 있습니다.
[edit]
중첩된 표
{| border=1
| α
|
{| bgcolor=#ABCDEF border=2
|nested
|-
|table
|}
|the original table again
|}
처럼 중첩된 표를 사용할 수도 있습니다.
| α |
| the original table again |
[edit]
COLSPAN과 ROWSPAN의 사용
여러 줄, 또는 여러 칸에 걸친 표를 만들 수 있습니다.
{| border="1" cellpadding="5" cellspacing="0"
|-
! Column 1 || Column 2 || Column 3
|-
| rowspan=2| A
| colspan=2 align="center"| B
|-
| C
| D
|-
| E
| colspan=2 align="center"| F
|-
| rowspan=3| G
| H
| I
|-
| J
| K
|-
| colspan=2 align="center"| L
|}
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| A | B | |
| C | D | |
| E | F | |
| G | H | I |
| J | K | |
| L | ||
