aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/html/element/colgroup/index.html
blob: 24993546d18d1ee534365151aefbe20fd90a0b10 (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
---
title: <colgroup>
slug: Web/HTML/Element/colgroup
tags:
  - Element
  - HTML
  - HTML tabular data
  - Reference
  - Web
translation_of: Web/HTML/Element/colgroup
---
<div>{{HTMLRef}}</div>

<p><span class="seoSummary"><strong>HTML <code>&lt;colgroup&gt;</code> 요소</strong>는 표의 열을 묶는 그룹을 정의합니다.</span></p>

<div>{{EmbedInteractiveExample("pages/tabbed/colgroup.html","tabbed-taller")}}</div>

<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples </a> and send us a pull request.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/ko/docs/Web/Guide/HTML/Content_categories">콘텐츠 카테고리</a></th>
   <td>없음.</td>
  </tr>
  <tr>
   <th scope="row">가능한 콘텐츠</th>
   <td>{{htmlattrxref("span", "colgroup")}} 특성이 존재하는 경우 없음. {{glossary("empty element", "빈 요소")}}입니다.<br>
    그렇지 않은 경우 0개 이상의 {{htmlelement("col")}} 요소.</td>
  </tr>
  <tr>
   <th scope="row">태그 생략</th>
   <td>첫 번째 자식이 {{htmlelement("col")}} 요소이며, 바로 앞의 요소가 닫는 태그를 생략한 <code>&lt;colgroup&gt;</code> 요소가 아닐 때, 여는 태그를 생략할 수 있습니다.<br>
    바로 뒤에 스페이스나 주석이 오지 않으면 닫는 태그를 생략할 수 있습니다.</td>
  </tr>
  <tr>
   <th scope="row">가능한 부모 요소</th>
   <td>{{HTMLElement("table")}} 요소. <code>&lt;colgroup&gt;</code>은 모든 {{HTMLElement("thead")}}, {{HTMLElement("th")}}, {{HTMLElement("tbody")}}, {{HTMLElement("tfoot")}}, {{HTMLElement("tr")}} 요소 앞에 위치해야 하며, <code>&lt;table&gt;</code> 안에 {{htmlelement("caption")}} 요소가 존재하는 경우 <code>&lt;caption&gt;</code> 뒤에 와야 합니다.</td>
  </tr>
  <tr>
   <th scope="row">가능한 ARIA 역할</th>
   <td>없음</td>
  </tr>
  <tr>
   <th scope="row">DOM 인터페이스</th>
   <td>{{domxref("HTMLTableColElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="특성">특성</h2>

<p>이 요소는 <a href="/ko/docs/Web/HTML/Global_attributes" title="HTML/Global attributes">전역 특성</a>을 포함합니다.</p>

<dl>
 <dt>{{htmlattrdef("bgcolor")}} {{Non-standard_inline}}</dt>
 <dd>열 그룹의 배경색. '#' 문자로 시작하는 <a href="/ko/docs/Web/CSS/color_value#RGB_색상">6자리 16진수 RGB 코드</a> 또는 <a href="/ko/docs/Web/CSS/color_value#색상_키워드">사전 정의된 색상 키워드</a>를 사용할 수 있습니다.
 <div class="note"><strong>참고:</strong> 표준 특성이 아니므로 사용하지 마세요. 배경색을 적용하려면 CSS {{cssxref("background-color")}} 특성을 사용해야 합니다.</div>
 </dd>
 <dt>{{htmlattrdef("span")}}</dt>
 <dd><code>&lt;colgroup&gt;</code>이 차지할 열의 수를 나타내는 양의 정수. 기본값은 1입니다. 내부에 {{htmlelement("col")}} 요소가 존재하면 사용할 수 없습니다.</dd>
</dl>

<div class="hidden">
<h3 id="Obsolete_attributes">Obsolete attributes</h3>

<div class="blockIndicator note">
<p><strong>Note:</strong> Do not use these attributes as they are obsolete (and not supported) in the latest standard.</p>
</div>

<dl>
 <dt>{{htmlattrdef("char")}} {{obsolete_inline}}</dt>
 <dd>This attribute specifies the alignment of the content in a column group to a character. Typical values for this include a period (.) when attempting to align numbers or monetary values. If {{htmlattrxref("align", "colgroup")}} is not set to <code>char</code>, this attribute is ignored, though it will still be used as the default value for the {{htmlattrxref("align", "col")}} of the {{HTMLElement("col")}} which are members of this column group.
 <div class="note"><strong>Note: </strong>To achieve the same effect as the <code>char</code> attribute, in CSS3, you can use the character set using the <code>char</code> attribute as the value of the {{cssxref("text-align")}} property {{unimplemented_inline}}.</div>
 </dd>
</dl>

<dl>
 <dt>{{htmlattrdef("charoff")}} {{obsolete_inline}}</dt>
 <dd>This attribute is used to indicate the number of characters to offset the column data from the alignment character specified by the <strong>char</strong> attribute.</dd>
</dl>

<dl>
 <dt>{{htmlattrdef("valign")}} {{obsolete_inline}}</dt>
 <dd>This attribute specifies the vertical alignment of the text within each cell of the column. Possible values for this attribute are:
 <ul>
  <li><code>baseline</code>, which will put the text as close to the bottom of the cell as it is possible, but align it on the <a class="external" href="https://en.wikipedia.org/wiki/Baseline_%28typography%29">baseline</a> of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as <code>bottom</code>.</li>
  <li><code>bottom</code>, which will put the text as close to the bottom of the cell as it is possible;</li>
  <li><code>middle</code>, which will center the text in the cell;</li>
  <li>and <code>top</code>, which will put the text as close to the top of the cell as it is possible.</li>
 </ul>

 <div class="note"><strong>Note: </strong>

 <ul>
  <li>Do not try to set the {{cssxref("vertical-align")}} property on a selector giving a {{HTMLElement("colgroup")}} element. Because {{HTMLElement("td")}} elements are not descendant of the {{HTMLElement("colgroup")}} element, they won't inherit it.</li>
  <li>If the table doesn't use a {{htmlattrxref("colspan", "td")}} attribute, use the <code>td:nth-child(an+b)</code> CSS selector per column, where a is the total number of the columns in the table and b is the ordinal position of the column in the table. Only after this selector the {{cssxref("vertical-align")}} property can be used.</li>
  <li>If the table does use a {{htmlattrxref("colspan", "td")}} attribute, the effect can be achieved by combining adequate CSS attribute selectors like <code>[colspan=n]</code>, though this is not trivial.</li>
 </ul>
 </div>
 </dd>
</dl>
</div>

<h2 id="예제">예제</h2>

<p><code>&lt;colgroup&gt;</code> 요소의 예제는 {{htmlelement("table")}} 요소 문서에서 볼 수 있습니다.</p>

<h2 id="Specifications" name="Specifications">명세</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">명세</th>
   <th scope="col">상태</th>
   <th scope="col">주석</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'tabular-data.html#the-colgroup-element', '&lt;colgroup&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'tabular-data.html#the-colgroup-element', '&lt;colgroup&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'tables.html#edef-COLGROUP', '&lt;colgroup&gt;')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>



<p>{{Compat("html.elements.colgroup")}}</p>