-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathResponsiveTable.css
More file actions
67 lines (59 loc) · 1.45 KB
/
ResponsiveTable.css
File metadata and controls
67 lines (59 loc) · 1.45 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
/* inspired by: https://css-tricks.com/responsive-data-tables/ */
.responsiveTable {
width: 100%;
}
.responsiveTable td .tdBefore {
display: none;
}
@media screen and (max-width: 40em) {
/*
Force table elements to not behave like tables anymore
Hide table headers (but not display: none;, for accessibility)
*/
.responsiveTable table,
.responsiveTable thead,
.responsiveTable tbody,
.responsiveTable th,
.responsiveTable td,
.responsiveTable tr {
display: block;
}
.responsiveTable thead tr {
position: absolute;
top: -9999px;
left: -9999px;
border-bottom: 2px solid #333;
}
.responsiveTable tbody tr {
flex-direction: column;
min-width: 0;
margin-bottom: 1.5rem;
word-wrap: break-word;
background-clip: border-box;
border: 1px solid;
border-radius: 0.25rem;
background-color: #fff;
border-color: #d8dbe0;
}
.responsiveTable td.pivoted {
/* Behave like a "row" */
border: none !important;
position: relative;
padding-left: calc(50% + 10px) !important;
text-align: left !important;
white-space: pre-wrap;
overflow-wrap: break-word;
}
.responsiveTable td .tdBefore {
/* Now like a table header */
position: absolute;
display: block;
/* Top/left values mimic padding */
left: 1rem;
width: calc(50% - 20px);
white-space: pre-wrap;
overflow-wrap: break-word;
text-align: left !important;
font-weight: 600;
}
}