aboutsummaryrefslogtreecommitdiff
path: root/less/tables.less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-07-17 20:44:27 -0700
committerMark Otto <[email protected]>2013-07-17 20:44:27 -0700
commitf0d071832284d968f2cb72b0bb576f8112a349de (patch)
tree9766c8da2b7c6890cdc794a2d93d4ca81c191047 /less/tables.less
parentc5fb401a626c3e0d99a764cb7961e1bd3e619e8f (diff)
parentbfebf0e490c795601220f74b7089adb4f47acda7 (diff)
downloadbootstrap-f0d071832284d968f2cb72b0bb576f8112a349de.tar.xz
bootstrap-f0d071832284d968f2cb72b0bb576f8112a349de.zip
Merge branch '3.0.0-wip' into bs3_remove_examples
Conflicts: docs/_includes/nav-getting-started.html docs/examples/navbar-fixed-top.html docs/examples/navbar-static-top.html docs/examples/navbar.html docs/getting-started.html
Diffstat (limited to 'less/tables.less')
-rw-r--r--less/tables.less170
1 files changed, 95 insertions, 75 deletions
diff --git a/less/tables.less b/less/tables.less
index fa5fd554b..9d39ad39f 100644
--- a/less/tables.less
+++ b/less/tables.less
@@ -19,27 +19,32 @@ th {
width: 100%;
margin-bottom: @line-height-computed;
// Cells
- 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;
+ thead,
+ tbody,
+ tfoot {
+ > tr {
+ > th,
+ > td {
+ padding: 8px;
+ line-height: @line-height-base;
+ vertical-align: top;
+ border-top: 1px solid @table-border-color;
+ }
+ }
}
// Bottom align for column headings
thead > tr > th {
vertical-align: bottom;
}
// Remove top border from thead by default
- caption + thead tr:first-child th,
- caption + thead tr:first-child td,
- 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;
+ caption + thead,
+ colgroup + thead,
+ thead:first-child {
+ tr:first-child {
+ th, td {
+ border-top: 0;
+ }
+ }
}
// Account for multiple tbody instances
tbody + tbody {
@@ -58,11 +63,15 @@ th {
// -------------------------------
.table-condensed {
- thead > tr > th,
- tbody > tr > th,
- thead > tr > td,
- tbody > tr > td {
- padding: 4px 5px;
+ thead,
+ tbody,
+ tfoot {
+ > tr {
+ > th,
+ > td {
+ padding: 4px 5px;
+ }
+ }
}
}
@@ -77,11 +86,15 @@ th {
border-left: 0;
border-radius: @border-radius-base;
- > thead > tr > th,
- > tbody > tr > th,
- > thead > tr > td,
- > tbody > tr > td {
- border-left: 1px solid @table-border-color;
+ > thead,
+ > tbody,
+ > tfoot {
+ > tr {
+ > th,
+ > td {
+ border-left: 1px solid @table-border-color;
+ }
+ }
}
// Prevent a double border
> caption + thead > tr:first-child th,
@@ -95,33 +108,31 @@ 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 {
- 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 {
- 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 {
- 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 {
- border-bottom-right-radius: @border-radius-base;
+ > thead:first-child > tr:first-child > th,
+ > tbody:first-child > tr:first-child > td,
+ > tbody:first-child > tr:first-child > th {
+ // For first th/td in the first row in the first thead or tbody
+ &:first-child{
+ border-top-left-radius: @border-radius-base;
+ }
+ // For last th/td in the first row in the first thead or tbody
+ &:last-child{
+ border-top-right-radius: @border-radius-base;
+ }
+ }
+ > thead:last-child > tr:last-child > th,
+ > tbody:last-child > tr:last-child > td,
+ > tbody:last-child > tr:last-child > th,
+ > tfoot:last-child > tr:last-child > td,
+ > tfoot:last-child > tr:last-child > th {
+ // For first th/td (can be either) in the last row in the last thead, tbody, and tfoot
+ &: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
+ &: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
@@ -133,19 +144,18 @@ th {
}
// 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 {
- 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 {
- border-top-right-radius: @border-radius-base;
+ > caption,
+ > colgroup {
+ + thead > tr:first-child > th,
+ + tbody > tr:first-child > td {
+ &:first-child {
+ border-top-left-radius: @border-radius-base;
+ }
+ &:last-child {
+ border-top-right-radius: @border-radius-base;
+ }
+ }
}
-
}
@@ -156,9 +166,11 @@ th {
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
.table-striped {
> tbody {
- > tr:nth-child(odd) > td,
- > tr:nth-child(odd) > th {
- background-color: @table-bg-accent;
+ > tr:nth-child(odd) {
+ > td,
+ > th {
+ background-color: @table-bg-accent;
+ }
}
}
}
@@ -171,9 +183,11 @@ th {
// Placed here since it has to come after the potential zebra striping
.table-hover {
> tbody {
- > tr:hover > td,
- > tr:hover > th {
- background-color: @table-bg-hover;
+ > tr:hover {
+ > td,
+ > th {
+ background-color: @table-bg-hover;
+ }
}
}
}
@@ -184,16 +198,22 @@ th {
// -----------------
// Reset default table behavior
-table col[class*="col-span-"] {
+table col[class^="col-"] {
float: none;
display: table-column;
}
-table td[class*="col-span-"],
-table th[class*="col-span-"] {
- float: none;
- display: table-cell;
+table {
+ td,
+ th {
+ &[class^="col-"] {
+ float: none;
+ display: table-cell;
+ }
+ }
}
+
+
// TABLE BACKGROUNDS
// -----------------
// Exact selectors below required to override .table-striped