2013-11-16 06:21:12 +08:00
|
|
|
//
|
|
|
|
// Tables
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// BASE TABLES
|
|
|
|
// -----------------
|
|
|
|
|
2015-06-01 01:40:54 +08:00
|
|
|
// table {
|
|
|
|
.table {
|
2013-11-16 06:21:12 +08:00
|
|
|
max-width: 100%;
|
|
|
|
border-collapse: collapse;
|
|
|
|
border-spacing: 0;
|
|
|
|
width: 100%;
|
2022-11-03 03:49:38 +08:00
|
|
|
margin-bottom: 1.43em;
|
2013-11-16 06:21:12 +08:00
|
|
|
// Cells
|
|
|
|
th,
|
|
|
|
td {
|
|
|
|
padding: 8px;
|
2022-11-03 03:49:38 +08:00
|
|
|
line-height: 1.43em;
|
2023-04-11 18:55:59 +08:00
|
|
|
text-align: inherit;
|
2021-02-12 00:46:29 +08:00
|
|
|
vertical-align: text-top;
|
2022-11-03 03:49:38 +08:00
|
|
|
border-top: 1px solid var(--border-color, #ddd);
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
th {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
// Bottom align for column headings
|
|
|
|
thead th {
|
|
|
|
vertical-align: bottom;
|
|
|
|
}
|
|
|
|
// Remove top border from thead by default
|
|
|
|
colgroup + thead tr:first-child th,
|
|
|
|
colgroup + thead tr:first-child td,
|
|
|
|
thead:first-child tr:first-child th,
|
|
|
|
thead:first-child tr:first-child td {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BORDERED VERSION
|
|
|
|
// ----------------
|
|
|
|
|
|
|
|
.table-bordered {
|
2022-11-03 03:49:38 +08:00
|
|
|
border: 1px solid var(--border-color, #ddd);
|
2013-11-16 06:21:12 +08:00
|
|
|
border-collapse: separate; // Done so we can round those corners!
|
2020-09-03 03:30:23 +08:00
|
|
|
border-radius: 4px;
|
2021-08-27 02:10:14 +08:00
|
|
|
th + th,
|
|
|
|
td + td {
|
2022-11-03 03:49:38 +08:00
|
|
|
border-left: 1px solid var(--border-color, #ddd);
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
// Prevent a double border
|
|
|
|
colgroup + thead tr:first-child th,
|
|
|
|
colgroup + tbody tr:first-child th,
|
|
|
|
colgroup + tbody tr:first-child td,
|
|
|
|
thead:first-child tr:first-child th,
|
|
|
|
tbody:first-child tr:first-child th,
|
|
|
|
tbody:first-child tr:first-child td {
|
|
|
|
border-top: 0;
|
|
|
|
}
|
|
|
|
// For first th or td in the first row in the first thead or tbody
|
|
|
|
thead:first-child tr:first-child th:first-child,
|
|
|
|
tbody:first-child tr:first-child td:first-child {
|
2020-09-02 23:06:35 +08:00
|
|
|
border-radius: 4px 0 0 0;
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
thead:first-child tr:first-child th:last-child,
|
|
|
|
tbody:first-child tr:first-child td:last-child {
|
2020-09-02 23:06:35 +08:00
|
|
|
border-radius: 0 4px 0 0;
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
// For first th or td in the first row in the first thead or tbody
|
|
|
|
thead:last-child tr:last-child th:first-child,
|
|
|
|
tbody:last-child tr:last-child td:first-child,
|
|
|
|
tfoot:last-child tr:last-child td:first-child {
|
2020-09-02 23:06:35 +08:00
|
|
|
border-radius: 0 0 0 4px;
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
thead:last-child tr:last-child th:last-child,
|
|
|
|
tbody:last-child tr:last-child td:last-child,
|
|
|
|
tfoot:last-child tr:last-child td:last-child {
|
2020-09-02 23:06:35 +08:00
|
|
|
border-radius: 0 0 4px 0;
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Special fixes to round the left border on the first td/th
|
|
|
|
colgroup + thead tr:first-child th:first-child,
|
|
|
|
colgroup + tbody tr:first-child td:first-child {
|
2020-09-02 23:06:35 +08:00
|
|
|
border-radius: 4px 0 0 0;
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
colgroup + thead tr:first-child th:last-child,
|
|
|
|
colgroup + tbody tr:first-child td:last-child {
|
2020-09-02 23:06:35 +08:00
|
|
|
border-radius: 0 4px 0 0;
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ZEBRA-STRIPING
|
|
|
|
// --------------
|
|
|
|
|
|
|
|
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
|
|
|
|
.table-striped {
|
|
|
|
tbody {
|
|
|
|
tr:nth-child(odd) td,
|
|
|
|
tr:nth-child(odd) th {
|
2022-11-03 03:49:38 +08:00
|
|
|
background-color: var(--tr-odd-bg-clr, #f9f9f9);
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// HOVER EFFECT
|
|
|
|
// ------------
|
|
|
|
// Placed here since it has to come after the potential zebra striping
|
|
|
|
.table-hover {
|
|
|
|
tbody {
|
|
|
|
tr:hover td,
|
|
|
|
tr:hover th {
|
2022-11-03 03:49:38 +08:00
|
|
|
background-color: var(--tr-hover-bg-clr, #f5f5f5);
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|