HTML 범위 속성


정의 및 사용

span속성은 열 또는 요소가 확장되어야 하는 열 수를 정의 <col>합니다 <colgroup>.


에 적용

속성 은 span다음 요소에 사용할 수 있습니다.

집단 기인하다
<콜> 기간
<콜그룹> 기간

열 예

여기에서 처음 두 열의 배경색은 빨간색이어야 합니다.

<table>
  <colgroup>
    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
  </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 예

<colgroup> span 속성을 사용하여 처음 두 열의 배경색을 설정합니다.

<table>
  <colgroup span="2" style="background:red"></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>
  <tr>
    <td>5869207</td>
    <td>My first CSS</td>
    <td>$49</td>
  </tr>
</table>

브라우저 지원

특성 은 span각 요소에 대해 다음 브라우저 지원을 가집니다.

Element
col Yes Yes Yes Yes Yes
colgroup Yes Yes Yes Yes Yes