0506 HTML

김정호·2021년 5월 6일
0

HTML

목록 보기
2/2

셀 합침

table : 표만들기
tr : 행(row)
td : 열(column)
th : 제목셀(굵은글씨)
속성 border는 테두리선의 굵기

<table border="1">
    <caption>표의 제목</caption>
    <tr>
        <th>1행 1열</th>
        <th>1행 2열</th>
        <th>1행 3열</th>
    </tr>
    <tr>
        <td>2행 1열</td>
        <td>2행 2열</td>
        <td>2행 3열</td>
    </tr>
    <tr>
        <td>3행 1열</td>
        <td>3행 2열</td>
        <td>3행 3열</td>
    </tr>
</table>

<table border="1">
    <caption>셀 합침</caption>
    <tr>
        <th colspan="2">1행 12열</th> 

colspan속성: 셀의 열 합침(가로), colspan = "숫자값"(셀의갯수)

       <th>1행 3열</th>
   </tr>
   <tr>
       <td>2행 1열</td>
      <td rowspan="2">23행 2열</td>

rowspan속성: 셀의 행 합침(가로), rowspan = "숫자값"(셀의갯수)

       <td>2행 3열</td>
    </tr>
    <tr>
       <td>3행 1열</td>
      
       <td>3행 3열</td>
    </tr>
</table>    
profile
안녕하세요

0개의 댓글