A table that only looks like one
Hours and insurance lists are the two tables a practice site most needs. Many are built by making cells bold or shaded, and nothing in the page code says which cell is a heading. To a sighted visitor the layout does the work. To a screen reader, the page is a string of cells, and a visitor hears something like Monday nine five Tuesday nine five with no sense of which time is opening and which is closing.
That matters most for the facts patients check before they call: when are you open and does the practice take my plan.
What the W3C tutorial says
The W3C Tables Tutorial, which we read, states the rule briefly: header cells must be marked with the th element and data cells with the td element to make a table accessible. It adds that for more complex tables, explicit links between headers and cells may be needed through the scope, id and headers attributes. The reason it gives is that screen readers speak one cell at a time and use the associated headers so the listener does not lose context.
The Info and Relationships criterion says the same in general terms: when information is shown by rows and columns, the relationship of each cell to its row and column header must be available to software, not only visible.
| Table type | What to mark |
|---|---|
| Hours: days down the side, open and close across the top | Both the top row and the day names as headers, using the scope attribute |
| Insurance: plan name down the side, one column for accepted | Top row as column headers, plan names as row headers |
| Hours with a lunch closure split into two rows | Treat as an irregular table and check with the W3C page on irregular headers |
| A layout grid used only to place pictures | Not a data table; use ordinary styling instead |
Check your own tables
- 1Open the hours page and right-click the table, then choose Inspect.
- 2Look for th tags in the first row. If every cell shows td, no cell is marked as a header.
- 3Look at the first column. If days or plan names are td, they are not row headers either.
- 4Turn on a screen reader and move through a row, following our screen reader test, and listen for the column name before each time.
- 5Repeat for the insurance table and any fee-free schedule tables on service pages.
Tables with two header levels
If your hours table has a header that spans several columns, such as Morning and Afternoon over two sub-columns, the W3C irregular tables page shows how to set a range with colgroup and the scope attribute. Ask your developer to follow that example and to test it by listening, not by reading code.
Accuracy comes first, whatever the markup. Our guide to split hours and lunch closures explains how to word the schedule, and the guide on a clear accepted insurance page covers what the table should say. We do not give legal advice, and correct header cells alone do not make a site conform to any standard.
Frequently asked questions
Can I just use bold text for the headings?
Bold is a visual change only. A screen reader does not know bold text is a heading. The cell has to be marked as a header in the code. Most page builders have a Header row option in the table settings that does it for you.
Should I use a list instead of a table for hours?
A short list of days and times also works well, especially on a phone, and the W3C describes tables as meant for data in a grid. If you keep a table, mark the headers. If your hours are simple, a list is often easier to build correctly.
What is the scope attribute?
It is a small tag on a header cell that tells software whether the header applies to a column or a row. For a plain table with one header row and one header column, it removes any doubt about direction. Your developer will know it by name.
Does my website builder do this automatically?
Some do and some do not. Do not assume. Inspect your live table, as in the steps above, and look for th tags. If you only see td, ask the builder's support how to turn on header cells for that table.
Does this help search engines too?
We cannot promise a ranking effect. Clear structure makes a page easier for software of every kind to read, but the reason to fix it is that a patient who uses a screen reader can then hear your hours correctly.
Sources
- W3C Web Accessibility Initiative — Tables Tutorial
- W3C Web Accessibility Initiative — Tables with Irregular Headers
- W3C Web Accessibility Initiative — Understanding Success Criterion 1.3.1: Info and Relationships