2011-11-26 13:34:55 +08:00
|
|
|
//
|
2012-06-29 12:46:45 +08:00
|
|
|
// Tables
|
|
|
|
// --------------------------------------------------
|
2011-05-04 09:09:25 +08:00
|
|
|
|
2012-01-21 05:16:40 +08:00
|
|
|
table {
|
2014-12-03 06:02:35 +08:00
|
|
|
background-color: $table-bg;
|
2012-01-21 05:16:40 +08:00
|
|
|
}
|
2014-07-13 06:55:15 +08:00
|
|
|
caption {
|
2014-12-03 06:02:35 +08:00
|
|
|
padding-top: $table-cell-padding;
|
|
|
|
padding-bottom: $table-cell-padding;
|
|
|
|
color: $text-muted;
|
2014-07-13 06:55:15 +08:00
|
|
|
text-align: left;
|
|
|
|
}
|
2013-02-09 00:24:10 +08:00
|
|
|
th {
|
|
|
|
text-align: left;
|
|
|
|
}
|
2012-10-01 14:59:35 +08:00
|
|
|
|
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Baseline styles
|
2011-05-04 09:09:25 +08:00
|
|
|
|
2012-01-18 15:39:18 +08:00
|
|
|
.table {
|
2011-05-04 09:09:25 +08:00
|
|
|
width: 100%;
|
2014-06-09 07:54:05 +08:00
|
|
|
max-width: 100%;
|
2014-12-05 07:25:57 +08:00
|
|
|
margin-bottom: $spacer;
|
|
|
|
|
2012-01-18 15:39:18 +08:00
|
|
|
// Cells
|
2013-08-28 08:13:07 +08:00
|
|
|
> thead,
|
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
2013-07-03 02:25:57 +08:00
|
|
|
> tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-03 06:02:35 +08:00
|
|
|
padding: $table-cell-padding;
|
|
|
|
line-height: $line-height-base;
|
2013-07-03 02:25:57 +08:00
|
|
|
vertical-align: top;
|
2014-12-03 06:02:35 +08:00
|
|
|
border-top: 1px solid $table-border-color;
|
2013-07-03 02:25:57 +08:00
|
|
|
}
|
|
|
|
}
|
2012-01-18 15:39:18 +08:00
|
|
|
}
|
2012-02-11 15:07:32 +08:00
|
|
|
// Bottom align for column headings
|
2013-08-28 08:13:07 +08:00
|
|
|
> thead > tr > th {
|
2012-02-11 15:07:32 +08:00
|
|
|
vertical-align: bottom;
|
2014-12-03 06:02:35 +08:00
|
|
|
border-bottom: 2px solid $table-border-color;
|
2012-01-18 15:39:18 +08:00
|
|
|
}
|
|
|
|
// Remove top border from thead by default
|
2014-08-06 08:45:24 +08:00
|
|
|
// > caption + thead,
|
|
|
|
// > colgroup + thead,
|
|
|
|
// > thead:first-child {
|
|
|
|
// > tr:first-child {
|
|
|
|
// > th,
|
|
|
|
// > td {
|
|
|
|
// border-top: 0;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
2012-01-18 15:39:18 +08:00
|
|
|
// Account for multiple tbody instances
|
2013-08-28 08:13:07 +08:00
|
|
|
> tbody + tbody {
|
2014-12-03 06:02:35 +08:00
|
|
|
border-top: 2px solid $table-border-color;
|
2012-01-18 15:39:18 +08:00
|
|
|
}
|
2012-12-09 04:57:21 +08:00
|
|
|
|
|
|
|
// Nesting
|
2014-08-06 08:45:24 +08:00
|
|
|
// .table {
|
2014-12-03 06:02:35 +08:00
|
|
|
// background-color: $body-bg;
|
2014-08-06 08:45:24 +08:00
|
|
|
// }
|
2012-01-12 01:43:13 +08:00
|
|
|
}
|
|
|
|
|
2011-11-01 10:37:10 +08:00
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Condensed table w/ half padding
|
2011-11-01 10:37:10 +08:00
|
|
|
|
2014-09-18 13:14:27 +08:00
|
|
|
.table-sm {
|
2013-08-28 08:13:07 +08:00
|
|
|
> thead,
|
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
2013-07-03 02:25:57 +08:00
|
|
|
> tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-03 06:02:35 +08:00
|
|
|
padding: $table-sm-cell-padding;
|
2013-07-03 02:25:57 +08:00
|
|
|
}
|
|
|
|
}
|
2011-09-09 01:47:05 +08:00
|
|
|
}
|
2011-11-01 10:37:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Bordered version
|
2013-08-19 12:43:05 +08:00
|
|
|
//
|
|
|
|
// Add borders all around the table and between all the columns.
|
2011-11-01 10:37:10 +08:00
|
|
|
|
2012-01-15 13:28:47 +08:00
|
|
|
.table-bordered {
|
2014-12-03 06:02:35 +08:00
|
|
|
border: 1px solid $table-border-color;
|
2013-07-03 02:25:57 +08:00
|
|
|
> thead,
|
2013-07-06 03:15:00 +08:00
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
2013-07-03 02:25:57 +08:00
|
|
|
> tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-03 06:02:35 +08:00
|
|
|
border: 1px solid $table-border-color;
|
2013-07-03 02:25:57 +08:00
|
|
|
}
|
2013-07-01 20:29:41 +08:00
|
|
|
}
|
2012-07-20 12:06:42 +08:00
|
|
|
}
|
2013-09-21 00:06:48 +08:00
|
|
|
> thead > tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
|
|
|
border-bottom-width: 2px;
|
2013-08-18 05:15:33 +08:00
|
|
|
}
|
|
|
|
}
|
2011-05-04 09:09:25 +08:00
|
|
|
}
|
|
|
|
|
2011-06-30 15:15:37 +08:00
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Zebra-striping
|
2013-08-19 12:43:05 +08:00
|
|
|
//
|
2011-11-30 14:35:03 +08:00
|
|
|
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
|
2013-08-19 12:43:05 +08:00
|
|
|
|
2013-11-07 10:32:35 +08:00
|
|
|
.table-striped {
|
|
|
|
> tbody > tr:nth-child(odd) {
|
2014-12-03 06:02:35 +08:00
|
|
|
background-color: $table-bg-accent;
|
2011-11-30 14:35:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Hover effect
|
2013-08-19 12:43:05 +08:00
|
|
|
//
|
2012-02-05 18:28:42 +08:00
|
|
|
// Placed here since it has to come after the potential zebra striping
|
2013-08-19 12:43:05 +08:00
|
|
|
|
2013-11-07 10:32:35 +08:00
|
|
|
.table-hover {
|
|
|
|
> tbody > tr:hover {
|
2014-12-03 06:02:35 +08:00
|
|
|
background-color: $table-bg-hover;
|
2012-02-05 18:28:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-30 14:35:03 +08:00
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Table cell sizing
|
2013-08-19 12:43:05 +08:00
|
|
|
//
|
2013-03-01 14:47:32 +08:00
|
|
|
// Reset default table behavior
|
2013-08-19 12:43:05 +08:00
|
|
|
|
2013-08-20 00:30:38 +08:00
|
|
|
table col[class*="col-"] {
|
2013-12-01 15:04:55 +08:00
|
|
|
position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623)
|
2013-03-01 14:47:32 +08:00
|
|
|
float: none;
|
|
|
|
display: table-column;
|
|
|
|
}
|
2013-07-03 02:25:57 +08:00
|
|
|
table {
|
2013-07-06 03:15:00 +08:00
|
|
|
td,
|
|
|
|
th {
|
2013-08-20 00:30:38 +08:00
|
|
|
&[class*="col-"] {
|
2013-12-19 13:10:58 +08:00
|
|
|
position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623)
|
2013-07-03 02:25:57 +08:00
|
|
|
float: none;
|
|
|
|
display: table-cell;
|
|
|
|
}
|
|
|
|
}
|
2012-06-26 05:37:35 +08:00
|
|
|
}
|
|
|
|
|
2013-06-24 06:05:50 +08:00
|
|
|
|
2013-07-24 01:48:30 +08:00
|
|
|
// Table backgrounds
|
2013-08-19 12:43:05 +08:00
|
|
|
//
|
2013-07-24 13:27:49 +08:00
|
|
|
// Exact selectors below required to override `.table-striped` and prevent
|
|
|
|
// inheritance to nested tables.
|
2012-08-08 13:50:49 +08:00
|
|
|
|
2013-08-19 12:43:05 +08:00
|
|
|
// Generate the contextual variants
|
2014-12-03 06:02:35 +08:00
|
|
|
@include table-row-variant(active, $table-bg-active);
|
|
|
|
@include table-row-variant(success, $state-success-bg);
|
|
|
|
@include table-row-variant(info, $state-info-bg);
|
|
|
|
@include table-row-variant(warning, $state-warning-bg);
|
|
|
|
@include table-row-variant(danger, $state-danger-bg);
|
2013-08-19 12:43:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
// Responsive tables
|
|
|
|
//
|
2013-08-23 14:53:09 +08:00
|
|
|
// Wrap your tables in `.table-responsive` and we'll make them mobile friendly
|
2013-08-19 12:43:05 +08:00
|
|
|
// by enabling horizontal scrolling. Only applies <768px. Everything above that
|
|
|
|
// will display normally.
|
|
|
|
|
2014-02-15 02:48:17 +08:00
|
|
|
.table-responsive {
|
2014-08-03 04:05:11 +08:00
|
|
|
overflow-x: auto;
|
2014-10-26 11:20:24 +08:00
|
|
|
min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)
|
2014-08-03 04:05:11 +08:00
|
|
|
|
2014-12-03 06:02:35 +08:00
|
|
|
@media screen and (max-width: $screen-xs-max) {
|
2013-08-19 12:43:05 +08:00
|
|
|
width: 100%;
|
2014-12-05 07:25:57 +08:00
|
|
|
margin-bottom: $spacer;
|
2013-08-19 12:43:05 +08:00
|
|
|
overflow-y: hidden;
|
2013-08-23 14:53:09 +08:00
|
|
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
2014-12-03 06:02:35 +08:00
|
|
|
border: 1px solid $table-border-color;
|
2013-08-19 12:43:05 +08:00
|
|
|
|
2013-09-21 00:06:48 +08:00
|
|
|
// Tighten up spacing
|
2013-08-19 12:43:05 +08:00
|
|
|
> .table {
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
// Ensure the content doesn't wrap
|
|
|
|
> thead,
|
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
|
|
|
> tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Special overrides for the bordered tables
|
|
|
|
> .table-bordered {
|
|
|
|
border: 0;
|
|
|
|
|
|
|
|
// Nuke the appropriate borders so that the parent can handle them
|
|
|
|
> thead,
|
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
|
|
|
> tr {
|
|
|
|
> th:first-child,
|
|
|
|
> td:first-child {
|
|
|
|
border-left: 0;
|
|
|
|
}
|
|
|
|
> th:last-child,
|
|
|
|
> td:last-child {
|
|
|
|
border-right: 0;
|
|
|
|
}
|
|
|
|
}
|
2013-09-08 23:04:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Only nuke the last row's bottom-border in `tbody` and `tfoot` since
|
|
|
|
// chances are there will be only one `tr` in a `thead` and that would
|
|
|
|
// remove the border altogether.
|
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
2013-08-19 12:43:05 +08:00
|
|
|
> tr:last-child {
|
|
|
|
> th,
|
|
|
|
> td {
|
|
|
|
border-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-08 23:04:11 +08:00
|
|
|
|
2013-08-19 12:43:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-07-14 14:45:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
.table > .thead-inverse {
|
|
|
|
> tr > th {
|
|
|
|
color: #fff;
|
2014-12-03 06:02:35 +08:00
|
|
|
background-color: $gray-dark;
|
2014-07-14 14:45:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.table > .thead-default {
|
|
|
|
> tr > th {
|
2014-12-03 06:02:35 +08:00
|
|
|
color: $gray;
|
|
|
|
background-color: $gray-lighter;
|
2014-07-14 14:45:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-14 15:23:46 +08:00
|
|
|
.table-inverse {
|
2014-12-03 06:02:35 +08:00
|
|
|
color: $gray-lighter;
|
|
|
|
background-color: $gray-dark;
|
2014-07-14 15:23:46 +08:00
|
|
|
|
|
|
|
&.table-bordered {
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> thead,
|
|
|
|
> tbody {
|
|
|
|
> tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-03 06:02:35 +08:00
|
|
|
border-color: $gray;
|
2014-07-14 15:23:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-08-06 08:45:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
.table-reflow {
|
|
|
|
|
|
|
|
thead {
|
|
|
|
float: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
tbody {
|
|
|
|
display: block;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
> thead,
|
|
|
|
> tbody,
|
|
|
|
> tfoot {
|
|
|
|
> tr {
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-03 06:02:35 +08:00
|
|
|
border-top: 1px solid $table-border-color;
|
|
|
|
border-left: 1px solid $table-border-color;
|
2014-08-06 08:45:24 +08:00
|
|
|
|
|
|
|
&:last-child {
|
2014-12-03 06:02:35 +08:00
|
|
|
border-right: 1px solid $table-border-color;
|
2014-08-06 08:45:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
> tr:last-child {
|
|
|
|
> th,
|
|
|
|
> td {
|
2014-12-03 06:02:35 +08:00
|
|
|
border-bottom: 1px solid $table-border-color;
|
2014-08-06 08:45:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tr {
|
|
|
|
float: left;
|
|
|
|
|
|
|
|
th,
|
|
|
|
td {
|
|
|
|
display: block !important;
|
2014-12-03 06:02:35 +08:00
|
|
|
border: 1px solid $table-border-color;
|
2014-08-06 08:45:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|