개요

Untitled

테이블 구조 설계

<table>
    <caption>위치 및 면적</caption>
    <thead>
        <tr>
            <th rowspan="2">단</th>
            <th colspan="2">경도와 위도의 극점</th>
            <th rowspan="2">연장거리(㎞)</th>
        </tr>
        <tr>
            <th>지명</th>
            <th>극점</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>동단</th>
            <td>탑동동(왕방산)</td>
            <td>동경 127˚ 03′ 49″</td>
            <td rowspan="4">
                동서간 12.9㎞<br>
                남북간 15.3㎞
            </td>
        </tr>
        <tr>
            <th>서단</th>
            <td>상패동(사천리)</td>
            <td>동경 127˚ 00′ 37″</td>
        </tr>
        <tr>
            <th>남단</th>
            <td>탑동동(장 림)</td>
            <td>북위 37˚ 50′ 34″</td>
        </tr>
        <tr>
            <th>북단</th>
            <td>하봉암동(옥녀봉)</td>
            <td>북위 37˚ 58′ 50″</td>
        </tr>
    </tbody>
</table>
  1. <table> 태그 작성
  2. 표의 제목 <caption> 태그 작성
  3. 여러 행을 묶어줄 행 구조 <thead> <tbody> <tfoot>태그 작성
  4. 행 태그 <tr> 태그 작성
  5. 첫 번째 줄 <th> <td> 태그 작성
  6. 스타일 입히기(css)

테이블의 열(cloumn)에 공통적으로 옵션을 주고 싶을 때

<table>
    <caption>위치 및 면적</caption>
		<colgroup>
		        <col span="2" style="background: yellow">
						<col style="background: blue">
		        <col style="background: red">
		</colgroup>
		<thead>
				...
		</thead>
		<tbody>
				...
		</tbody>
</table>

Untitled