HTML <th> colspan 속성

❮ HTML <th> 태그

예시

두 개의 열에 걸쳐 있는 헤더 셀이 있는 HTML 테이블:

<table>
  <tr>
    <th colspan="2">Monthly Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

정의 및 사용

속성 은 colspan헤더 셀이 확장되어야 하는 열의 수를 정의합니다.


브라우저 지원

Attribute
colspan Yes Yes Yes Yes Yes

참고: Firefox에서만 colspan="0"특별한 의미가 있는 를 지원합니다(아래 "속성 값" 표 참조).


통사론

<th colspan="number">

속성 값

Value Description
number Sets the number of columns a header cell should span. Note: colspan="0" tells the browser to span the cell to the last column of the column group (colgroup)

❮ HTML <th> 태그