</table>
{% endexample %}
+{% example html %}
+<table class="table table-striped table-inverse">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>First Name</th>
+ <th>Last Name</th>
+ <th>Username</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">1</th>
+ <td>Mark</td>
+ <td>Otto</td>
+ <td>@mdo</td>
+ </tr>
+ <tr>
+ <th scope="row">2</th>
+ <td>Jacob</td>
+ <td>Thornton</td>
+ <td>@fat</td>
+ </tr>
+ <tr>
+ <th scope="row">3</th>
+ <td>Larry</td>
+ <td>the Bird</td>
+ <td>@twitter</td>
+ </tr>
+ </tbody>
+</table>
+{% endexample %}
+
## Bordered table
Add `.table-bordered` for borders on all sides of the table and cells.
</table>
{% endexample %}
+{% example html %}
+<table class="table table-bordered table-inverse">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>First Name</th>
+ <th>Last Name</th>
+ <th>Username</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">1</th>
+ <td>Mark</td>
+ <td>Otto</td>
+ <td>@mdo</td>
+ </tr>
+ <tr>
+ <th scope="row">2</th>
+ <td>Mark</td>
+ <td>Otto</td>
+ <td>@TwBootstrap</td>
+ </tr>
+ <tr>
+ <th scope="row">3</th>
+ <td>Jacob</td>
+ <td>Thornton</td>
+ <td>@fat</td>
+ </tr>
+ <tr>
+ <th scope="row">4</th>
+ <td colspan="2">Larry the Bird</td>
+ <td>@twitter</td>
+ </tr>
+ </tbody>
+</table>
+{% endexample %}
+
## Hoverable rows
Add `.table-hover` to enable a hover state on table rows within a `<tbody>`.
</table>
{% endexample %}
+{% example html %}
+<table class="table table-hover table-inverse">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>First Name</th>
+ <th>Last Name</th>
+ <th>Username</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">1</th>
+ <td>Mark</td>
+ <td>Otto</td>
+ <td>@mdo</td>
+ </tr>
+ <tr>
+ <th scope="row">2</th>
+ <td>Jacob</td>
+ <td>Thornton</td>
+ <td>@fat</td>
+ </tr>
+ <tr>
+ <th scope="row">3</th>
+ <td colspan="2">Larry the Bird</td>
+ <td>@twitter</td>
+ </tr>
+ </tbody>
+</table>
+{% endexample %}
+
## Small table
Add `.table-sm` to make tables more compact by cutting cell padding in half.
</table>
{% endexample %}
+{% example html %}
+<table class="table table-sm table-inverse">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>First Name</th>
+ <th>Last Name</th>
+ <th>Username</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">1</th>
+ <td>Mark</td>
+ <td>Otto</td>
+ <td>@mdo</td>
+ </tr>
+ <tr>
+ <th scope="row">2</th>
+ <td>Jacob</td>
+ <td>Thornton</td>
+ <td>@fat</td>
+ </tr>
+ <tr>
+ <th scope="row">3</th>
+ <td colspan="2">Larry the Bird</td>
+ <td>@twitter</td>
+ </tr>
+ </tbody>
+</table>
+{% endexample %}
+
## Contextual classes
Use contextual classes to color table rows or individual cells.
@include table-row-variant(danger, $state-danger-bg);
-// Responsive tables
+// Inverse styles
//
-// Wrap your tables in `.table-responsive` and we'll make them mobile friendly
-// by enabling horizontal scrolling. Only applies <768px. Everything above that
-// will display normally.
-
-.table-responsive {
- display: block;
- width: 100%;
- min-height: .01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)
- overflow-x: auto;
-
- // TODO: find out if we need this still.
- //
- // border: $table-border-width solid $table-border-color;
- // -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057
-}
-
+// Same table markup, but inverted color scheme—dark background and light text.
.thead-inverse {
th {
background-color: $gray-dark;
}
}
+
.thead-default {
th {
color: $gray;
color: $gray-lighter;
background-color: $gray-dark;
- &.table-bordered {
- border: 0;
- }
-
th,
td,
thead th {
border-color: $gray;
}
+
+ &.table-bordered {
+ border: 0;
+ }
+}
+
+
+
+// Responsive tables
+//
+// Wrap your tables in `.table-responsive` and we'll make them mobile friendly
+// by enabling horizontal scrolling. Only applies <768px. Everything above that
+// will display normally.
+
+.table-responsive {
+ display: block;
+ width: 100%;
+ min-height: .01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)
+ overflow-x: auto;
+
+ // TODO: find out if we need this still.
+ //
+ // border: $table-border-width solid $table-border-color;
+ // -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057
}
$table-sm-cell-padding: .3rem !default;
$table-bg: transparent !default;
-$table-bg-accent: #f9f9f9 !default;
-$table-bg-hover: #f5f5f5 !default;
+$table-bg-accent: rgba(0,0,0,.05) !default;
+$table-bg-hover: rgba(0,0,0,.075) !default;
$table-bg-active: $table-bg-hover !default;
$table-border-width: $border-width !default;