Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- XML
- html
- instruction
- system
- mysql
- Pipelining
- for
- Algorithm
- web
- control
- DB
- architecture
- CSS
- MIPS
- php
- javascript
- DATAPATH
- MacOS
- Class
- github
- react
- Linux
- DS
- DoM
- function
- data structure
- python
- while
- Java
- computer
Archives
- Today
- Total
YYYEJI
[HTML] Table 기본 태그 정리 본문
728x90

표를 만드는 태그의 속성을 나타내는 tag는 여러 개가 있습니다.
<table> - 표를 만드는 태그
<thead> - 표의 제목 영역
<tbody> - 표의 본문 영역
<tfoot> - 표의 끝 영역
<tr> - 표의 행
<td> - 표의 데이터 (왼쪽 정렬, 기본 폰트)
<th> - 표의 head (중앙 정렬, 볼드체)
<thead> tag를 통해 표의 제목에 값을 넣어줍니다.
<thead>
<tr><th>Grade</th><th>Number</th></tr>
</thead>

<hbody> tag를 통해 표의 본문 영역에 값을 넣어줍니다.
<tbody>
<tr>
<td>Freshman</td>
<td>35</td>
</tr>
<tr>
<td>Sophomore</td>
<td>27</td>
</tr>
<tr>
<td>Junior</td>
<td>31</td>
</tr>
<tr>
<td>Senior</td>
<td>25</td>
</tr>
</tbody>

<tfoot> tag를 통해 표의 마지막 영역에 값을 넣어줍니다.
<tfoot>
<tr>
<th>Total</th>
<th>118</th>
</tr>
</tfoot>

↓↓↓ 전체 코드 ↓↓↓
<table border = "1" width = "30%" summary = "This table provides information about Students">
<thead>
<tr><th>Grade</th><th>Number</th></tr>
</thead>
<tbody>
<tr>
<td>Freshman</td>
<td>35</td>
</tr>
<tr>
<td>Sophomore</td>
<td>27</td>
</tr>
<tr>
<td>Junior</td>
<td>31</td>
</tr>
<tr>
<td>Senior</td>
<td>25</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Total</th>
<th>118</th>
</tr>
</tfoot>
</table>

border-collapse를 사용하면 table의 border을 하나로 모아줍니다.
<style>
table {
border-collapse: collapse;
}
</style>

◡̈
'HTML(or XML) & CSS & JavaScript' 카테고리의 다른 글
[PHP] PHP 출력문 (0) | 2022.12.12 |
---|---|
[HTML] Table 열, 행 merge 시키는 태그 (0) | 2022.11.12 |
[HTML] Ordered List의 Special Marker (0) | 2022.11.12 |
[HTML] Unordered List의 Special Marker (0) | 2022.11.12 |
[HTML] HTML의 list (ul, ol, dl) (0) | 2022.11.12 |