Posted on January 23rd, 2009 - 11:10 pm - no comments
I bet you, like me, remember how tables used to rule the Internet. Hell, I even thought with tables back then. Now, it should only be used for data, like it was intended to:
Let’s say you’ve got a table that shows your swimming records for January 2009, and the HTML would look like this:
<table border="1" cellspacing="0" cellpadding="0" class="oneBorder" width="50%"> <tr><th>Date</th><th>Meters</th></tr> <tr>8th<td></td><td>2000</td></tr> <tr>11th<td></td><td>4000</td></tr> <tr>21st<td></td><td>1650</td></tr> <tr>26th<td></td><td>3550</td></tr> <tr>31st<td></td><td>1200</td></tr> </table>
and the table, with given class and stylings, looks like this:
| Date | Meters |
|---|---|
| 8th | 2000 |
| 11th | 4000 |
| 21st | 1650 |
| 26th | 3550 |
| 31st | 1200 |
Now, when it comes to making it more accessible, you’ve got to enrich the table with more meta-information. The HTML would then look like this:
<table border="1" cellspacing="0" cellpadding="0" class="oneBorder" width="50%" summary="Meters swum on given dates through January 2009"> <caption>Swimming Records January 2009</caption> <thead><tr><th scope="col">Date</th><th scope="col">Meters</th></tr></thead> <tbody> <tr><td>8th</td><td>2000</td></tr> <tr><td>11th</td><td>4000</td></tr> <tr><td>21st</td><td>1650</td></tr> <tr><td>26th</td><td>3550</td></tr> <tr><td>31st</td><td>1200</td></tr> </tbody> </table>
and then the table looks like this:
| Date | Meters |
|---|---|
| 8th | 2000 |
| 11th | 4000 |
| 21st | 1650 |
| 26th | 3550 |
| 31st | 1200 |
As you’ve seen in the markup above, there’s some attributes you generally don’t see on the Internet. Here’s a definition list of the added attributions:
Note: The summary-attribute won’t show for regular users. It’s there so the person using a screen reader will get an overview of the table layout before the table is read by the reader.
If you’re in dire need of more information about screen readers, or accessibility in general, I would recommend buying the book called Web Accessibility: Web Standards and Regulatory Compliance:

I would go as far as calling it the “Bible of Accessibility”, because you learn alot through its 640 pages. It covers everything from using accessible markup, JavaScript and PDFs, to accessibility laws and compliances (such as 508 in the US).
Tags: accessibility, html, tables
Go to top - koew.net©2006-2010 if not noted otherwise. - All pages are printer-friendly
Write a comment