▶ HTML 표에는 여러 행과 열을 병합한 셀이 있을 수 있다.

 

■ HTML 표 - Colspan

▶ 여러 열에 셀을 병합하려면 "colspan" 속성을 사용한다.

<table>
  <tr>
    <th colspan="2">Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>43</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>57</td>
  </tr>
</table>

실습 : https://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_colspan2 

 

※ "colspan" 속성 값은 병합할 열의 수로 나타낸다.

 

■ HTML 표 - Rowspan

▶ 여러 행의 셀을 병합하려면 "rowspan" 속성을 사용한다.

<table>
  <tr>
    <th>Name</th>
    <td>Jill</td>
  </tr>
  <tr>
    <th rowspan="2">Phone</th>
    <td>555-1234</td>
  </tr>
  <tr>
    <td>555-8745</td>
</tr>
</table>

실습 : https://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_rowspan2 

 

※ "rowspan" 속성 값은 병합할 행의 수로 나타낸다.

 

출처 : https://www.w3schools.com/html/html_table_colspan_rowspan.asp

 

HTML Table Colspan & Rowspan

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

'HTML' 카테고리의 다른 글

HTMP / (28) 표 Colgroup  (0) 2023.02.21
HTML / (27) 표 Styling  (0) 2023.02.21
HTML / (25) 표 Padding & Spacing  (0) 2023.02.21
HTML / (24) 표 머리글  (0) 2023.02.21
HTML / (23) 표 크기  (0) 2023.02.20

+ Recent posts