aboutsummaryrefslogtreecommitdiff
path: root/less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-04-14 20:33:10 -0700
committerMark Otto <[email protected]>2013-04-14 20:33:54 -0700
commit5471ce8ea3471562cc56dd3e349982c54f6ed624 (patch)
tree0aebbe7586e6cd315c142df67f054790e51020fa /less
parentab7070bb49cf4cd68d19c84ce5a50ee939b9589d (diff)
downloadbootstrap-5471ce8ea3471562cc56dd3e349982c54f6ed624.tar.xz
bootstrap-5471ce8ea3471562cc56dd3e349982c54f6ed624.zip
Fixes #5256: Use > selector for better nesting of tables
Diffstat (limited to 'less')
-rw-r--r--less/tables.less90
1 files changed, 48 insertions, 42 deletions
diff --git a/less/tables.less b/less/tables.less
index 52261815e..b62f22fb6 100644
--- a/less/tables.less
+++ b/less/tables.less
@@ -21,15 +21,17 @@ th {
width: 100%;
margin-bottom: @line-height-base;
// Cells
- th,
- td {
+ thead > tr > th,
+ tbody > tr > th,
+ thead > tr > td,
+ tbody > tr > td {
padding: 8px;
line-height: @line-height-base;
vertical-align: top;
border-top: 1px solid @table-border-color;
}
// Bottom align for column headings
- thead th {
+ thead > tr > th {
vertical-align: bottom;
}
// Remove top border from thead by default
@@ -58,8 +60,10 @@ th {
// -------------------------------
.table-condensed {
- th,
- td {
+ thead > tr > th,
+ tbody > tr > th,
+ thead > tr > td,
+ tbody > tr > td {
padding: 4px 5px;
}
}
@@ -74,70 +78,72 @@ th {
border-collapse: separate; // Done so we can round those corners!
border-left: 0;
border-radius: @border-radius-base;
- th,
- td {
+ thead > tr > th,
+ tbody > tr > th,
+ thead > tr > td,
+ tbody > tr > td {
border-left: 1px solid @table-border-color;
}
// Prevent a double border
- caption + thead tr:first-child th,
- caption + tbody tr:first-child th,
- caption + tbody tr:first-child td,
- 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 {
+ caption + thead > tr:first-child th,
+ caption + tbody > tr:first-child th,
+ caption + tbody > tr:first-child td,
+ 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/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,
- tbody:first-child tr:first-child > th:first-child {
+ thead:first-child > tr:first-child > th:first-child,
+ tbody:first-child > tr:first-child > td:first-child,
+ tbody:first-child > tr:first-child > th:first-child {
border-top-left-radius: @border-radius-base;
}
// For last th/td in the first row in the first thead or tbody
- thead:first-child tr:first-child > th:last-child,
- tbody:first-child tr:first-child > td:last-child,
- tbody:first-child tr:first-child > th:last-child {
+ thead:first-child > tr:first-child > th:last-child,
+ tbody:first-child > tr:first-child > td:last-child,
+ tbody:first-child > tr:first-child > th:last-child {
border-top-right-radius: @border-radius-base;
}
// For first th/td (can be either) in the last row in the last thead, tbody, and tfoot
- thead:last-child tr:last-child > th:first-child,
- tbody:last-child tr:last-child > td:first-child,
- tbody:last-child tr:last-child > th:first-child,
- tfoot:last-child tr:last-child > td:first-child,
- tfoot:last-child tr:last-child > th:first-child {
+ thead:last-child > tr:last-child > th:first-child,
+ tbody:last-child > tr:last-child > td:first-child,
+ tbody:last-child > tr:last-child > th:first-child,
+ tfoot:last-child > tr:last-child > td:first-child,
+ tfoot:last-child > tr:last-child > th:first-child {
border-bottom-left-radius: @border-radius-base;
}
// For last th/td (can be either) in the last row in the last thead, tbody, and tfoot
- thead:last-child tr:last-child > th:last-child,
- tbody:last-child tr:last-child > td:last-child,
- tbody:last-child tr:last-child > th:last-child,
- tfoot:last-child tr:last-child > td:last-child,
- tfoot:last-child tr:last-child > th:last-child {
+ thead:last-child > tr:last-child > th:last-child,
+ tbody:last-child > tr:last-child > td:last-child,
+ tbody:last-child > tr:last-child > th:last-child,
+ tfoot:last-child > tr:last-child > td:last-child,
+ tfoot:last-child > tr:last-child > th:last-child {
border-bottom-right-radius: @border-radius-base;
}
// Clear border-radius for first and last td in the last row in the last tbody for table with tfoot
- tfoot + tbody:last-child tr:last-child > td:first-child {
+ tfoot + tbody:last-child > tr:last-child > td:first-child {
border-bottom-left-radius: 0;
}
- tfoot + tbody:last-child tr:last-child > td:last-child {
+ tfoot + tbody:last-child > tr:last-child > td:last-child {
border-bottom-right-radius: 0;
}
// Special fixes to round the left border on the first td/th
- caption + thead tr:first-child th:first-child,
- caption + tbody tr:first-child td:first-child,
- colgroup + thead tr:first-child th:first-child,
- colgroup + tbody tr:first-child td:first-child {
+ caption + thead > tr:first-child > th:first-child,
+ caption + tbody > tr:first-child > td:first-child,
+ colgroup + thead > tr:first-child > th:first-child,
+ colgroup + tbody > tr:first-child > td:first-child {
border-top-left-radius: @border-radius-base;
}
- caption + thead tr:first-child th:last-child,
- caption + tbody tr:first-child td:last-child,
- colgroup + thead tr:first-child th:last-child,
- colgroup + tbody tr:first-child td:last-child {
+ caption + thead > tr:first-child > th:last-child,
+ caption + tbody > tr:first-child > td:last-child,
+ colgroup + thead > tr:first-child > th:last-child,
+ colgroup + tbody > tr:first-child > td:last-child {
border-top-right-radius: @border-radius-base;
}