-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss_display_table_elements.html
More file actions
88 lines (80 loc) · 2.58 KB
/
css_display_table_elements.html
File metadata and controls
88 lines (80 loc) · 2.58 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Display Elements</title>
<style>
.table {
display: table;
width: 100%;
border-collapse: collapse;
}
/* .table-column-group {
display: table-column-group;
} */
.table-column {
display: table-column;
}
.table-header-group {
display: table-header-group;
background-color: #f0f0f0;
font-weight: bold;
}
.table-row-group {
display: table-row-group;
}
.table-row {
display: table-row;
}
.table-cell {
display: table-cell;
padding: 10px;
border: 1px solid #ccc;
}
/* Styling individual columns */
.table-column:nth-child(1) { width: 30%; background-color: #ffeeee; }
.table-column:nth-child(2) { width: 40%; background-color: #eeffee; }
.table-column:nth-child(3) { width: 30%; background-color: #eeeeff; }
/* Zebra striping for rows */
.table-row-group .table-row:nth-child(even) {
background-color: #f9f9f9;
}
</style>
</head>
<body>
<div class="table">
<div class="table">
<div class="table-column-group">
<div class="table-column"></div>
<div class="table-column"></div>
<div class="table-column"></div>
</div>
<div class="table-header-group">
<div class="table-row">
<div class="table-cell">Header 1</div>
<div class="table-cell">Header 2</div>
<div class="table-cell">Header 3</div>
</div>
</div>
<div class="table-row-group">
<div class="table-row">
<div class="table-cell">Row 1, Cell 1</div>
<div class="table-cell">Row 1, Cell 2</div>
<div class="table-cell">Row 1, Cell 3</div>
</div>
<div class="table-row">
<div class="table-cell">Row 2, Cell 1</div>
<div class="table-cell">Row 2, Cell 2</div>
<div class="table-cell">Row 2, Cell 3</div>
</div>
<div class="table-row">
<div class="table-cell">Row 3, Cell 1</div>
<div class="table-cell">Row 3, Cell 2</div>
<div class="table-cell">Row 3, Cell 3</div>
</div>
</div>
</div>
</div>
</body>
</html>