WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Table headings question

for

Number of posts in this thread: 3 (In chronological order)

From: Preast, Vanessa
Date: Wed, Jul 26 2017 7:55AM
Subject: Table headings question
No previous message | Next message →

I've run across the following table code and am not sure what to think. The table has <th> for the row headers cells only; there are no column headers. The table is also missing a caption.

Do data tables have to have column headers and caption to be accessible, or are row headers sufficient?

<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<th>Hours</th>
<td>Monday-Friday from&nbsp;8 a.m. to 5 p.m</td>
</tr>
<tr>
<th>Appointments</th>
<td>[phone]</td>
</tr>
<tr>
<th>Location</th>
<td><a href="[url]"> [address]</a></td>
</tr>
</tbody>
</table></div>

Thanks,
Vanessa

From: Beranek, Nicholas
Date: Wed, Jul 26 2017 8:53AM
Subject: Re: Table headings question
← Previous message | Next message →

Those TH elements should have a scope="row". If they have visible text that could serve as a CAPTION, then have them properly mark it up. If not, then you may want them to add it or use the summary attribute. It doesn't look like they need column headers since it only has two columns and the first column has row headers.

Nick Beranek
Capital One

From: Jonathan Avila
Date: Wed, Jul 26 2017 10:26AM
Subject: Re: Table headings question
← Previous message | No next message

Agreed, it is possible to have a table with only row headers. An example is provided in this tutorial.
https://www.w3.org/WAI/tutorials/tables/one-header/

Jonathan

Jonathan Avila
Chief Accessibility Officer
Level Access, inc. (formerly SSB BART Group, inc.)
= EMAIL ADDRESS REMOVED =
703.637.8957 (Office)
Visit us online: Website | Twitter | Facebook | LinkedIn | Blog
Looking to boost your accessibility knowledge? Check out our free webinars!

The information contained in this transmission may be attorney privileged and/or confidential information intended for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication is strictly prohibited.