-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Expand file tree
/
Copy pathtable-css.html
More file actions
66 lines (60 loc) · 1.2 KB
/
table-css.html
File metadata and controls
66 lines (60 loc) · 1.2 KB
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Table CSS example</title>
<style>
html {
font-family: sans-serif;
}
table {
width: 600px;
border-collapse: collapse;
border: 1px solid black;
border-top: 3px solid black;
border-bottom: 3px solid black;
}
th,td {
padding: 10px;
}
td {
text-align: center;
}
th[scope="col"] {
background: #ccc;
}
tr:nth-child(even) {
background: #eee;
}
tr:nth-child(odd) {
background: #ddd;
}
</style>
</head>
<body>
<h1>Table CSS example</h1>
<table>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Gender</th>
</tr>
<tr>
<th scope="row">Gabriel</th>
<td>13</td>
<td>Male</td>
</tr>
<tr>
<th scope="row">Elva</th>
<td>8</td>
<td>Female</td>
</tr>
<tr>
<th scope="row">Freida</th>
<td>5</td>
<td>Female</td>
</tr>
</table>
</body>
</html>