info@54: // info@54: // Tables info@54: // -------------------------------------------------- info@54: info@54: info@54: table { info@54: max-width: 100%; info@54: background-color: @table-bg; info@54: } info@54: th { info@54: text-align: left; info@54: } info@54: info@54: info@54: // Baseline styles info@54: info@54: .table { info@54: width: 100%; info@54: margin-bottom: @line-height-computed; info@54: // Cells info@54: > thead, info@54: > tbody, info@54: > tfoot { info@54: > tr { info@54: > th, info@54: > td { info@54: padding: @table-cell-padding; info@54: line-height: @line-height-base; info@54: vertical-align: top; info@54: border-top: 1px solid @table-border-color; info@54: } info@54: } info@54: } info@54: // Bottom align for column headings info@54: > thead > tr > th { info@54: vertical-align: bottom; info@54: border-bottom: 2px solid @table-border-color; info@54: } info@54: // Remove top border from thead by default info@54: > caption + thead, info@54: > colgroup + thead, info@54: > thead:first-child { info@54: > tr:first-child { info@54: > th, info@54: > td { info@54: border-top: 0; info@54: } info@54: } info@54: } info@54: // Account for multiple tbody instances info@54: > tbody + tbody { info@54: border-top: 2px solid @table-border-color; info@54: } info@54: info@54: // Nesting info@54: .table { info@54: background-color: @body-bg; info@54: } info@54: } info@54: info@54: info@54: // Condensed table w/ half padding info@54: info@54: .table-condensed { info@54: > thead, info@54: > tbody, info@54: > tfoot { info@54: > tr { info@54: > th, info@54: > td { info@54: padding: @table-condensed-cell-padding; info@54: } info@54: } info@54: } info@54: } info@54: info@54: info@54: // Bordered version info@54: // info@54: // Add borders all around the table and between all the columns. info@54: info@54: .table-bordered { info@54: border: 1px solid @table-border-color; info@54: > thead, info@54: > tbody, info@54: > tfoot { info@54: > tr { info@54: > th, info@54: > td { info@54: border: 1px solid @table-border-color; info@54: } info@54: } info@54: } info@54: > thead > tr { info@54: > th, info@54: > td { info@54: border-bottom-width: 2px; info@54: } info@54: } info@54: } info@54: info@54: info@54: // Zebra-striping info@54: // info@54: // Default zebra-stripe styles (alternating gray and transparent backgrounds) info@54: info@54: .table-striped { info@54: > tbody > tr:nth-child(odd) { info@54: > td, info@54: > th { info@54: background-color: @table-bg-accent; info@54: } info@54: } info@54: } info@54: info@54: info@54: // Hover effect info@54: // info@54: // Placed here since it has to come after the potential zebra striping info@54: info@54: .table-hover { info@54: > tbody > tr:hover { info@54: > td, info@54: > th { info@54: background-color: @table-bg-hover; info@54: } info@54: } info@54: } info@54: info@54: info@54: // Table cell sizing info@54: // info@54: // Reset default table behavior info@54: info@54: table col[class*="col-"] { info@54: position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623) info@54: float: none; info@54: display: table-column; info@54: } info@54: table { info@54: td, info@54: th { info@54: &[class*="col-"] { info@54: float: none; info@54: display: table-cell; info@54: } info@54: } info@54: } info@54: info@54: info@54: // Table backgrounds info@54: // info@54: // Exact selectors below required to override `.table-striped` and prevent info@54: // inheritance to nested tables. info@54: info@54: // Generate the contextual variants info@54: .table-row-variant(active; @table-bg-active); info@54: .table-row-variant(success; @state-success-bg); info@54: .table-row-variant(danger; @state-danger-bg); info@54: .table-row-variant(warning; @state-warning-bg); info@54: info@54: info@54: // Responsive tables info@54: // info@54: // Wrap your tables in `.table-responsive` and we'll make them mobile friendly info@54: // by enabling horizontal scrolling. Only applies <768px. Everything above that info@54: // will display normally. info@54: info@54: @media (max-width: @screen-xs-max) { info@54: .table-responsive { info@54: width: 100%; info@54: margin-bottom: (@line-height-computed * 0.75); info@54: overflow-y: hidden; info@54: overflow-x: scroll; info@54: -ms-overflow-style: -ms-autohiding-scrollbar; info@54: border: 1px solid @table-border-color; info@54: -webkit-overflow-scrolling: touch; info@54: info@54: // Tighten up spacing info@54: > .table { info@54: margin-bottom: 0; info@54: info@54: // Ensure the content doesn't wrap info@54: > thead, info@54: > tbody, info@54: > tfoot { info@54: > tr { info@54: > th, info@54: > td { info@54: white-space: nowrap; info@54: } info@54: } info@54: } info@54: } info@54: info@54: // Special overrides for the bordered tables info@54: > .table-bordered { info@54: border: 0; info@54: info@54: // Nuke the appropriate borders so that the parent can handle them info@54: > thead, info@54: > tbody, info@54: > tfoot { info@54: > tr { info@54: > th:first-child, info@54: > td:first-child { info@54: border-left: 0; info@54: } info@54: > th:last-child, info@54: > td:last-child { info@54: border-right: 0; info@54: } info@54: } info@54: } info@54: info@54: // Only nuke the last row's bottom-border in `tbody` and `tfoot` since info@54: // chances are there will be only one `tr` in a `thead` and that would info@54: // remove the border altogether. info@54: > tbody, info@54: > tfoot { info@54: > tr:last-child { info@54: > th, info@54: > td { info@54: border-bottom: 0; info@54: } info@54: } info@54: } info@54: info@54: } info@54: } info@54: }