-
Notifications
You must be signed in to change notification settings - Fork 4
Responsive Tables
Some tables become difficult to read on smaller screens because there isn't enough horizontal space to accommodate all columns. Suitcase Interim detects a few different table types and then applies CSS and jQuery to change their look and layout to be more legible in a single column.
This responsive table solution uses jQuery to detect a table's structure:
- No headings in the table
- Headings are in the first row
- Headings are in the first column
- There are headings in first row and first column
Each of these tables requires a slightly different responsive solution.
Tables in node content automatically receive responsive table styles.
Tables created in Views are not responsive by default. If a Views table would benefit from being responsive, add the class `views-table-responsive' to the View.
- Edit the View
- Add the
views-table-responsive
class in CSS Class under the Advanced tab
Some tables are too wide for even very wide themes. To allow the table to scroll horizontally, add the 'views-table-overflow' class.
- Edit the View
- Add the
views-table-overflow
class in the CSS under the Advanced tab. Both this class and theviews-table-responsive
class can be applied to the same table