0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

use direct-child selector more in table styles to better support nested tables; fixes #10231

This commit is contained in:
Chris Rebert 2013-08-27 17:13:07 -07:00
parent 73f10843a4
commit 901da1b2b4
3 changed files with 35 additions and 34 deletions

View File

@ -1402,33 +1402,33 @@ th {
margin-bottom: 20px; margin-bottom: 20px;
} }
.table thead > tr > th, .table > thead > tr > th,
.table tbody > tr > th, .table > tbody > tr > th,
.table tfoot > tr > th, .table > tfoot > tr > th,
.table thead > tr > td, .table > thead > tr > td,
.table tbody > tr > td, .table > tbody > tr > td,
.table tfoot > tr > td { .table > tfoot > tr > td {
padding: 8px; padding: 8px;
line-height: 1.428571429; line-height: 1.428571429;
vertical-align: top; vertical-align: top;
border-top: 1px solid #dddddd; border-top: 1px solid #dddddd;
} }
.table thead > tr > th { .table > thead > tr > th {
vertical-align: bottom; vertical-align: bottom;
border-bottom: 2px solid #dddddd; border-bottom: 2px solid #dddddd;
} }
.table caption + thead tr:first-child th, .table > caption + thead > tr:first-child > th,
.table colgroup + thead tr:first-child th, .table > colgroup + thead > tr:first-child > th,
.table thead:first-child tr:first-child th, .table > thead:first-child > tr:first-child > th,
.table caption + thead tr:first-child td, .table > caption + thead > tr:first-child > td,
.table colgroup + thead tr:first-child td, .table > colgroup + thead > tr:first-child > td,
.table thead:first-child tr:first-child td { .table > thead:first-child > tr:first-child > td {
border-top: 0; border-top: 0;
} }
.table tbody + tbody { .table > tbody + tbody {
border-top: 2px solid #dddddd; border-top: 2px solid #dddddd;
} }
@ -1436,12 +1436,12 @@ th {
background-color: #ffffff; background-color: #ffffff;
} }
.table-condensed thead > tr > th, .table-condensed > thead > tr > th,
.table-condensed tbody > tr > th, .table-condensed > tbody > tr > th,
.table-condensed tfoot > tr > th, .table-condensed > tfoot > tr > th,
.table-condensed thead > tr > td, .table-condensed > thead > tr > td,
.table-condensed tbody > tr > td, .table-condensed > tbody > tr > td,
.table-condensed tfoot > tr > td { .table-condensed > tfoot > tr > td {
padding: 5px; padding: 5px;
} }

File diff suppressed because one or more lines are too long

View File

@ -18,9 +18,9 @@ th {
width: 100%; width: 100%;
margin-bottom: @line-height-computed; margin-bottom: @line-height-computed;
// Cells // Cells
thead, > thead,
tbody, > tbody,
tfoot { > tfoot {
> tr { > tr {
> th, > th,
> td { > td {
@ -32,22 +32,23 @@ th {
} }
} }
// Bottom align for column headings // Bottom align for column headings
thead > tr > th { > thead > tr > th {
vertical-align: bottom; vertical-align: bottom;
border-bottom: 2px solid @table-border-color; border-bottom: 2px solid @table-border-color;
} }
// Remove top border from thead by default // Remove top border from thead by default
caption + thead, > caption + thead,
colgroup + thead, > colgroup + thead,
thead:first-child { > thead:first-child {
tr:first-child { > tr:first-child {
th, td { > th,
> td {
border-top: 0; border-top: 0;
} }
} }
} }
// Account for multiple tbody instances // Account for multiple tbody instances
tbody + tbody { > tbody + tbody {
border-top: 2px solid @table-border-color; border-top: 2px solid @table-border-color;
} }
@ -61,9 +62,9 @@ th {
// Condensed table w/ half padding // Condensed table w/ half padding
.table-condensed { .table-condensed {
thead, > thead,
tbody, > tbody,
tfoot { > tfoot {
> tr { > tr {
> th, > th,
> td { > td {