속성을 정렬 COLGROUP HTML
예
두 <COLGROUP> 요소 테이블은 세 가지 다른 정렬 (첫 번째 <COLGROUP> 요소는이 걸쳐 있습니다)를 제공합니다 :
<table width="100%" border="1">
<colgroup span="2" align="left"></colgroup>
<colgroup align="right"></colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
<colgroup span="2" align="left"></colgroup>
<colgroup align="right"></colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
»시도
브라우저 지원
만 오페라 및 Internet Explorer 8 및 이전 버전 (IE 9가 지원하지 않는) 지원 align 속성을 (IE 9는 지원하지 않습니다).
정의 및 사용
HTML5에서 <COLGROUP> 정렬 속성을 지원하지 않습니다.
정렬 속성 컬럼 그룹 내용의 수평 정렬을 지정한다.
문법
<colgroup align="left|right|center|justify|char">
속성 값
值 | 描述 |
---|---|
left | 左对齐内容(默认值)。 |
right | 右对齐内容。 |
center | 居中对齐内容(th 元素的默认值)。 |
justify | 对行进行伸展,这样每行都可以有相等的宽度(就像在报纸和杂志中)。 |
char | 将内容对准指定字符。 |
HTML <COLGROUP> 태그