Responsive Tables
Play nice on various screen sizes!
Full TableResponsive
The first way to make a table responsive, is to wrap it with <div class="table-responsive"></div>
. This way the table will be horizontally scrollable and all the data will be accessible on smaller screens (< 768px). Try resizing your browser window to check it live!
Partial TableResponsive
The second way is to use specific CSS classes for hiding columns in various screen resolutions. This way you can hide the less important columns and keep the most valuable on mobiles. At the following example the Subscriptioncolumn isn't visible on small and extra small screens and Emailcolumn isn't visible on extra small screens. Try resizing your browser window to check it live!
Client | Actions | ||
---|---|---|---|
client1 | client1@example.com | ||
client2 | client2@example.com | ||
client3 | client3@example.com | ||
client4 | client4@example.com | ||
client5 | client5@example.com | ||
client6 | client6@example.com | ||
client7 | client7@example.com |
Below you can find all the available classes you can use to make your tables responsive. These classes also work with most HTML elements, so you can make them visible only on the screens you want, too.
Extra small devices Phones (<768px) |
Small devices Tablets (≥768px) |
Medium devices Desktops (≥992px) |
Large devices Desktops (≥1200px) |
|
---|---|---|---|---|
.visible-xs
|
||||
.visible-sm
|
||||
.visible-md
|
||||
.visible-lg
|
||||
.hidden-xs
|
||||
.hidden-sm
|
||||
.hidden-md
|
||||
.hidden-lg
|