-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.html
57 lines (57 loc) · 1.87 KB
/
table.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table, th, td {
border:1px solid #ccc;
border-collapse: collapse;
}
th, td { padding:10px 20px; }
</style>
</head>
<body>
<table>
<caption>선뮬용과 가정용 상품 구성</caption>
<colgroup> <!--열을 묶어주는 태그 각각 열마다 col을 붙여줘야 하고 col span="n"처럼 여러개로 묶어 한 번에 스타일을 지정해줄 수도 있다.-->
<col style="background-color : #eee">
<col>
<col span="2" style="width:150px;">
</colgroup>
<thead> <!--thead(제목), tbody(본문), tfoot(요약)-->
<tr>
<th>용도</th>
<th>중량</th>
<th>개수</th>
<th>가격</th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2">선물용</th> <!--rowspan은 세로로 셀을 합침, colspan은 가로로 셀을 합침 ) rowspan="합칠 셀 갯수"-->
<td>3kg</td> <!--th td태그를 한 tr에 넣어 각 행의 첫번째가 제목이 들어가도록 할 수 있다.-->
<td>11~16과</td>
<td>35,000원</td>
</tr>
<tr>
<td>5kg</td>
<td>18~26과</td>
<td>52,000원</td>
</tr>
<tr>
<td rowspan="2">가정용</td>
<td>3kg</td>
<td>11~16과</td>
<td>30,000원</td>
</tr>
<tr>
<td>5kg</td>
<td>18~26과</td>
<td>47,000원</td>
</tr>
</tbody>
</table>
</body>
</html>