All tables must include a caption element that describes the table in the same way you might use a heading element. A well-written caption adds context to a table and makes it easier to understand.
Use table header elements to describe what the data in rows or columns represents. It is a good idea to use the
scope attribute to denote whether a header applies to a row or a column to help users of assistive technology.
In general mobile devices have room for around three columns of data, depending on the length of the data being presented. If there is a lot of data in a table it might not display well on small screens. There are two alternative displays you can use, depending on your use case.
In a scrolling table, if there are too many columns to display in the content area the first column becomes sticky while the rest of the table is allowed to scroll beneath it. For that reason the data in the first column should be broadly indicative of what the data in the column is about, as in this example where it is the name of the item being described in the row of data.
- easy to compare data between rows
- table display is preserved
- requires additional interaction (scroll or swipe) from the user
- not all data is visible at once
Collapse to boxes
In a table that collapses to boxes, the rows of the table are transformed into individual blocks of data.
- provides an easily-digestable summary of the data
- difficult to compare data between rows, since they’ve now been transformed into boxes and separated
- does not look like a table and this non-standard display may be unfamiliar to users
Public and bank holidays (mygov.scot)
Feedback, help and support
There is a problem
Thanks for your feedback