From: Mark Otto Date: Thu, 19 Oct 2017 15:55:53 +0000 (-0700) Subject: Better docs for table-responsive classes (#24438) X-Git-Tag: v4.0.0-beta.2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c67ab1fa67f85b34daf552ac3a709c80448886a;p=thirdparty%2Fbootstrap.git Better docs for table-responsive classes (#24438) --- diff --git a/docs/4.0/content/tables.md b/docs/4.0/content/tables.md index 59bdb6373c..d4506c2c9f 100644 --- a/docs/4.0/content/tables.md +++ b/docs/4.0/content/tables.md @@ -579,11 +579,48 @@ Regular table background variants are not available with the dark table, however {% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %} {{ callout-include | markdownify }} -## Responsive tables -Create responsive tables by adding `.table-responsive{-sm|-md|-lg|-xl}` to any `.table` to make them scroll horizontally at each `max-width` breakpoint 575px, 767px, 991px, and 1199px, respectively. +## Captions -For responsive tables that always scroll horizontally when the table is wider than its container, add the `.table-responsive` class on `.table`. +A `` functions like a heading for a table. It helps users with screen readers to find a table and understand what it’s about and decide if they want to read it. + +{% example html %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
List of users
#First NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
+{% endexample %} + +## Responsive tables + +Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by adding `.table-responsive` class on `.table`. Or, pick a maximum breakpoint with which to have a responsive table up to by adding `.table-responsive{-sm|-md|-lg|-xl}`. {% callout warning %} #### Vertical clipping/truncation @@ -591,6 +628,8 @@ For responsive tables that always scroll horizontally when the table is wider th Responsive tables make use of `overflow-y: hidden`, which clips off any content that goes beyond the bottom or top edges of the table. In particular, this can clip off dropdown menus and other third-party widgets. {% endcallout %} +### Always responsive +
@@ -697,41 +736,57 @@ Responsive tables make use of `overflow-y: hidden`, which clips off any content
{% endhighlight %} +### Breakpoint specific -## Captions +Use `.table-responsive{-sm|-md|-lg|-xl}` as needed to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave normally and not scroll horizontally. -A `` functions like a heading for a table. It helps users with screen readers to find a table and understand what it’s about and decide if they want to read it. - -{% example html %} - - +
+{% for bp in site.data.breakpoints %}{% unless bp.breakpoint == "xs" %} +
List of users
- - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + +
#First NameLast NameUsernameTable headingTable headingTable headingTable headingTable heading
1MarkOtto@mdoTable cellTable cellTable cellTable cellTable cell
2JacobThornton@fatTable cellTable cellTable cellTable cellTable cell
3Larrythe Bird@twitterTable cellTable cellTable cellTable cellTable cell
-{% endexample %} +{% endunless %}{% endfor %} +
+ +{% highlight html %} +{% for bp in site.data.breakpoints %}{% unless bp.breakpoint == "xs" %} + + ... +
+{% endunless %}{% endfor %} +{% endhighlight %}