html Table 태그

2010.05.23 23:46

Elkha 조회 수:4440

참고 문서  

table.jpg

웹 표준

내가 html 언어를 접할때는 웹 표준에 대한 인식이 어느정도 자리잡혀 있었다. img, hr 같은 단일태그는 닫아 주어야 하고, font 태그보다는 style을 주로 사용해야 한다는 정도는 이미 어깨넘어로 배운 지식이었다. 덕분에 처음부터 div 태그를 주로 사용했었고, 그것에 매우 익숙해졌다. 하지만 div 태그만 사용한덕에 table 태그를 사용할때면 항상 버벅거린다. table 태그에 대해 알아보면서 그 과정을 문서로 정리해본다.

Table 태그의 종류

  • table
  • caption
  • col
  • colgroup
  • thead
  • tbody
  • tfoot
  • tr
  • th
  • td

예제

<table border="1" align="center">
<caption>table 태그의 구성 요소</caption>
<colgroup>
 <col style="background: none repeat scroll 0% 0% rgb(255, 238, 238);"/>
 <col style="background: none repeat scroll 0% 0% rgb(255, 255, 238);"/>
</colgroup>
<thead>
<tr>
 <th>태그명</th>
 <th>설명</th>
</tr>
</thead>
<tbody>
<tr>
 <th>caption</th>
 <td>제목을 표시</td>
</tr>
<tr>
 <th>colgroup</th>
 <td rowspan="2">칼럼(Columns) 요소들을 선택</td>
</tr>
<tr>
 <th>col</th>
</tr>
<tr>
 <th>thead</th>
 <td>표의 머리 부분</td>
</tr>
<tr>
 <th>tbody</th>
 <td>표 본문</td>
</tr>
<tr>
 <th>tfoot</th>
 <td>표의 꼬리 부분</td>
</tr>
<tr>
 <th>tr</th>
 <td>table row. 행을 나눈다.</td>
</tr>
<tr>
 <th>th</th>
 <td>table title. tr 태그에서 구분한 행의 제목을 가리킨다.</td>
</tr>
<tr>
 <th>th</th>
 <td>table data. tr 태그에서 구분한 행을 열 단위로 나눈다.</td>
</tr>
</tbody>
</table>

출력 결과

table 태그의 구성 요소
태그명 설명
caption 제목을 표시
colgroup 칼럼(Columns) 요소들을 선택
col
thead 표의 머리 부분
tbody 표 본문
tfoot 표의 꼬리 부분
tr table row. 행을 나눈다.
th table title. tr 태그에서 구분한 행의 제목을 가리킨다.
th table data. tr 태그에서 구분한 행을 열 단위로 나눈다.
번호 제목 날짜 조회 수
» Table 태그 file 2010.05.23 4440
20 포커스 요소의 테두리와 웹 접근성 file 2010.05.23 4179
19 리눅스 자동 시작 file 2010.05.21 15892
18 putty file 2010.05.21 13464
17 php 에서 파일 권한 설정 2010.05.21 4593
16 list-style file 2010.05.21 5154
15 jQuery 쿠키 file 2010.05.19 5016
14 php 쿠키 생성, 읽기 file 2010.05.19 7103
13 php 에서 텍스트 파일을 생성, 수정하기 file 2010.05.19 9922
12 파일 불러오기 file 2010.05.17 5471
11 php 암호화와 복호와 file 2010.05.17 7305
10 php 현재 시각 출력하기 file 2010.05.17 4458
9 html 파일에서 php 구문 숨기기 file 2010.05.17 6860
8 검색엔진 등록 file 2010.05.12 142340
7 VPS (가상 호스팅) 비교 file 2010.05.12 62200
6 sAPM file 2010.05.12 20260
5 Lighttpd 설치 file 2010.05.11 20677
4 Zend Optimizer + eAccelerator + Suhosin file 2010.05.11 18247
3 PHP 설치 file 2010.05.11 15056
2 Apache 설치 file 2010.05.11 16656