aboutsummaryrefslogtreecommitdiff
path: root/docs/content
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-05-08 14:15:34 -0700
committerMark Otto <[email protected]>2016-05-08 14:15:34 -0700
commit44778465da5f6a13a8438d20e22c1ef6d823f8a1 (patch)
tree637712b9b7157fd1b3a35d69c9194585c59370b7 /docs/content
parent2cc7c71ffecb3504dbafe69b104bfccda4bb02ad (diff)
downloadbootstrap-44778465da5f6a13a8438d20e22c1ef6d823f8a1.tar.xz
bootstrap-44778465da5f6a13a8438d20e22c1ef6d823f8a1.zip
Update table docs
- Change some things around, add some copy - Include table variant styles for the inverse tables thanks to bg and color utils
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/tables.md87
1 files changed, 80 insertions, 7 deletions
diff --git a/docs/content/tables.md b/docs/content/tables.md
index 00f794693..0ab0b538d 100644
--- a/docs/content/tables.md
+++ b/docs/content/tables.md
@@ -4,14 +4,16 @@ title: Tables
group: content
---
-Due to the widespread use of tables across third-party widgets like calendars and date pickers, we've designed our tables to be **opt-in**. Just add the base class `.table` to any `<table>`.
+Due to the widespread use of tables across third-party widgets like calendars and date pickers, we've designed our tables to be **opt-in**. Just add the base class `.table` to any `<table>`, then extend with custom styles or our various included modifier classes.
## Contents
* Will be replaced with the ToC, excluding the "Contents" header
{:toc}
-## Basic example
+## Examples
+
+Using the most basic table markup, here's how `.table`-based tables look in Bootstrap.
{% example html %}
<table class="table">
@@ -46,7 +48,7 @@ Due to the widespread use of tables across third-party widgets like calendars an
</table>
{% endexample %}
-## Inverse table
+You can also invert the colors—with light text on dark backgrounds—with `.table-inverse`.
{% example html %}
<table class="table table-inverse">
@@ -83,7 +85,7 @@ Due to the widespread use of tables across third-party widgets like calendars an
## Table head options
-Use one of two modifier classes to make `<thead>`s appear light or dark gray.
+Similar to default and inverse tables, use one of two modifier classes to make `<thead>`s appear light or dark gray.
{% example html %}
<table class="table">
@@ -420,9 +422,6 @@ Use contextual classes to color table rows or individual cells.
</table>
</div>
-{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
-{{ callout-include | markdownify }}
-
{% highlight html %}
<!-- On rows -->
<tr class="table-active">...</tr>
@@ -441,6 +440,80 @@ Use contextual classes to color table rows or individual cells.
</tr>
{% endhighlight %}
+Regular table background variants are not available with the inverse table, however, you may use [text or background utilities](/components/utilities/#contextual-colors-and-backgrounds) to achieve similar styles.
+
+<div class="bd-example">
+ <table class="table table-inverse">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Column heading</th>
+ <th>Column heading</th>
+ <th>Column heading</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="bg-primary">
+ <th scope="row">1</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr>
+ <th scope="row">2</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr class="bg-success">
+ <th scope="row">3</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr>
+ <th scope="row">4</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr class="bg-info">
+ <th scope="row">5</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr>
+ <th scope="row">6</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr class="bg-warning">
+ <th scope="row">7</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr>
+ <th scope="row">8</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ <tr class="bg-danger">
+ <th scope="row">9</th>
+ <td>Column content</td>
+ <td>Column content</td>
+ <td>Column content</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
+{{ callout-include | markdownify }}
+
## Responsive tables
Create responsive tables by wrapping any `.table` in `.table-responsive` to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.