-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-table-group.html
174 lines (164 loc) · 5.22 KB
/
html-table-group.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HTML - Table Grouping 2</title>
<link rel="icon" href="https://raw.githubusercontent.com/coding-dragon/coding-dragon.github.io/master/img/logo.png" type="image/x-icon">
<link rel="stylesheet" href="main.css">
<style>
table {
border-collapse: collapse;
border: 2px solid rgb(200, 200, 200);
letter-spacing: 1px;
font-family: sans-serif;
font-size: 16px;
}
th, td {
border: 1px solid rgb(190, 190, 190);
padding: 5px 10px;
}
td {
text-align: center;
}
thead, tfoot {
background-color: #3f87a6;
color: #fff;
}
tbody {
background-color: #e4f0f5;;
}
</style>
</head>
<body>
<div class="jumbotron" id="top">
<h2 class="display-3">HTMl Tables</h2>
<p class="lead">
HTML tables allow web developers to arrange data into rows and columns.
</p>
</div>
<div class="container p-3 bg-head">
<h3>Table content Grouping</h3>
<p class="lead">
As we go further in HTML tables, table content can be grouped together according to their specific area.
The HTML <b><thead></b> defines a set of rows defining the head of the columns of the table.<br/>
The HTML <b><tbody></b> encapsulates a set of table rows (<tr> elements), indicating that they comprise the body of the table.<br/>
The HTML <b><tfoot></b> element defines a set of rows summarizing the columns of the table.<br/>
</p>
<div class="code">
<pre>
<span><table>
<thead>
<tr>
<th></span>Items<span></th>
<th></span>Expenditure<span></th>
</tr>
</thead>
<tbody>
<tr>
<th></span>Donuts<span></th>
<td></span>3,000<span></td>
</tr>
</tbody>
<tfoot>
<tr>
<th></span>Totals<span></th>
<td></span>21,000<span></td>
</tr>
</tfoot>
</table></span></pre>
</div>
</div>
<br/>
<div class="container">
<table>
<thead>
<tr>
<th>Items</th>
<th>Expenditure</th>
</tr>
</thead>
<tbody>
<tr>
<th>Donuts</th>
<td>3,000</td>
</tr>
<tr>
<th>Stationery</th>
<td>18,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Totals</th>
<td>21,000</td>
</tr>
</tfoot>
</table>
</div>
<hr/>
<br/>
<br/>
<div class="container p-3 bg-head">
<h3>Grouping - <colgroup> and <col></h3>
<p class="lead">
The HTML <b><colgroup></b> defines a group of columns within a table.<br/>
The HTML <b><col></b> element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element<br/>
</p>
<div class="code">
<pre>
<span><table>
<thead>
<tr>
<th></span>Items<span></th>
<th></span>Expenditure<span></th>
</tr>
</thead>
<tbody>
<tr>
<th></span>Donuts<span></th>
<td></span>3,000<span></td>
</tr>
</tbody>
<tfoot>
<tr>
<th></span>Totals<span></th>
<td></span>21,000<span></td>
</tr>
</tfoot>
</table></span></pre>
</div>
</div>
<br/>
<div class="container">
<table>
<thead>
<tr>
<th>Items</th>
<th>Expenditure</th>
</tr>
</thead>
<tbody>
<tr>
<th>Donuts</th>
<td>3,000</td>
</tr>
<tr>
<th>Stationery</th>
<td>18,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Totals</th>
<td>21,000</td>
</tr>
</tfoot>
</table>
</div>
<hr/>
<br/>
<br/>
</body>
</html>