Related Tips and Techniques: Responsive Data Tables
Status: This is not ready for detailed review. It is an in-progress, unapproved editor’s draft.
Creating a table that works in both a desktop and mobile view is challenging. The fundamental problem is a data table of any significant size is designed to work well on larger screens. This is especially noticeable with more than just a few columns.
When wide tables are made to visually fit into a smaller screen, a table’s contents often become either too small to read without zooming in, or the table requires scrolling. Scrolling introduces one of two problems on small screens. If the row and column headers scroll out of view, it’s hard for users to remember what information they’re looking at; if headers are fixed and just the data portion scrolls, the interaction is unfamiliar to users, and it is difficult for developers to make a scrollable table with fixed headers that works on all mobile platforms and is accessible to all assistive technologies, especially screen readers.
For many tables, it’s better to redesign the way the data is presented for mobile views. The most logical transformation is to use a nested list instead of a table. One set of table headers becomes the first level list items, the other set of table headers along with the data cells becomes a nested list, and the caption for the table becomes the heading for the list. In this model, there are two separate data structures – a list and a table – but only one is visible on the screen at a time.
Responsive data table – large screen view
Monday | Tuesday | Wednesday | Thursday | Friday | |
---|---|---|---|---|---|
09:00 - 11:00 | Closed | Open | Open | Closed | Closed |
11:00 - 13:00 | Open | Open | Closed | Closed | Closed |
13:00 - 15:00 | Open | Open | Open | Closed | Closed |
15:00 - 17:00 | Closed | Closed | Closed | Open | Open |