-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
147 lines (129 loc) · 3.3 KB
/
example.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>responsive data table example markup</title>
<meta name="description" content="" />
<meta name="author" content="Andy Pillip" />
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
<style>
body {
margin: 0;
padding: 1em 5%;
font-family: sans-serif;
line-height: 1.4em;
}
h1, h2, h3, caption, th {
font-family: serif;
}
h1 {
font-size: 200%;
line-height: 1.4em;
margin: .7em 0;
}
h2 {
font-size: 150%;
line-height: 1.4em;
margin: .9333333em 0;
}
th[scope="row"] {
font-weight: bold;
margin: 1.4em 0 0;
}
th[scope="rowgroup"] {
font-size: 120%;
line-height: 1.166667em;
margin: 1.166667em 0 0;
}
p, table {
margin: .7em 0;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
table, thead, tfoot, tbody, tr, th, td {
display: block;
text-align: left;
}
tr {
margin: .6em 0;
}
thead {
height: 0;
overflow: hidden;
}
td[data-header]:before {
display: block;
margin: .7em 0 0;
font-weight: bold;
content: attr(data-header);
}
@media (min-width: 50em) {/* assume our reset table fits in there */
table {
display: table;
}
thead {
display: table-header-group;
}
tfoot {
display: table-footer-group;
}
tbody {
display: table-row-group;
}
tr {
display: table-row;
}
td, th {
display: table-cell;
}
td[data-header]:before {
content: none;
}
}
</style>
</head>
<body>
<header>
<h1>Some examples of responsive data tables</h1>
<h2>These responsive layouts are possible with the Contao extension <em>Responsive Tables</em></h2>
<p>
Resize your browser window to see the responsive effect
</p>
</header>
<section>
<h3>The simplest table ever</h3>
<p>
This is the one table created by the <em>content element table</em> when using first row as header and first column as row headers
</p>
<table>
<thead>
<tr>
<th id="th-name">name</th>
<th id="th-year">year</th>
<th id="th-age">age</th>
</tr>
</thead>
<tbody>
<tr>
<th headers="th-name" data-header="name" scope="row">Andy</th>
<td headers="th-year" data-header="year">1984</td>
<td headers="th-age" data-header="age">29</td>
</tr>
<tr>
<th headers="th-name" data-header="name" scope="row">Simon</th>
<td headers="th-year" data-header="year">1989</td>
<td headers="th-age" data-header="age">24</td>
</tr>
</tbody>
</table>
</section>
<footer>
<p>
© Copyright by <a href="mailto:[email protected]">Andy Pillip</a>
</p>
</footer>
</body>
</html>