WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Fwd: Table captions using span and css class wb-invisible from the template

for

From: Jared Smith
Date: Apr 22, 2013 8:51AM


On Mon, Apr 22, 2013 at 8:32 AM, Rabab Gomaa wrote:

> Removing the caption and have no summary (in HTML 5), would that fail WCAG
> 2.0 1.3.1 Info and Relationship?

I don't think so, but it's debatable. There is no requirement that a
table have a caption. But if there is a visual caption and that
caption is not associated to the table, then it may be a failure.

How likely it is for a screen reader user to encounter the table
without reading the visual caption first? And if they do this, will
the table still make sense to them?

> May be setting invisible caption is not the best approach. Do you think the
> use of ARIA role="heading" level="2" would be acceptable in this case?

I think this would work. You'd want to test it though. You could just
put the <h2> inside the <caption>. This seems to work well for
accessibility and in all browsers, though it is an HTML validation
issue.

Another approach would be:

<h2 id="tablecaption">Quebec</h2>
<table aria-labelledby="tablecaption">

Jared