E-mail List Archives

Re: Another rookie question: tables that use a heading rather than a caption

for

From: Sailesh Panchang
Date: Mar 29, 2017 1:56PM


The caption does serve as a table name or its identifier and helps
screen reader users for sure.
In other words, if the text rightly serves as the table's
name/identifier, use caption. Maybe the h-tag text should be
something else.
But I certainly do not advocate duplicating the h-tag text in an
off-screen caption to aid SR users.
Under an h<n> tag there could be content including one or more
tables. The table could be right after the h-tag or lower down.
When there are multiple tables under a heading, table identifiers (captions) help all users.
If the author has a good reason not to have specific table
identifiers and believes the h-tag provides the necessary context
that's fine too.
If there is a need to use aria-label / labelledby maybe it means the
UI and (usability for all)can be helped with visual captions for
tables.
PS: I began the response with 'It depends'. Then I saw Jennifer had
beaten me to the punch!
Best wishes,
Sailesh Panchang


On 3/29/17, Jeremy Echols < <EMAIL REMOVED> > wrote:
> Whoa... I had no idea. That's brilliant, thanks!
>
> Jennifer, thanks for all your input, no offense taken at all. I am
> definitely a novice in many areas and I'm learning just how often "it
> depends" comes up. In some cases, I'm actually starting to think a table
> doesn't make sense in the first place, but there are other cases where the
> page really does "feel" like it needs both the header and the caption. It's
> just so much grey area....
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Jared Smith
> Sent: Wednesday, March 29, 2017 12:45 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: Re: [WebAIM] Another rookie question: tables that use a heading
> rather than a caption
>
> Jeremy -
>
> With HTML5 you can place the heading inside the caption:
> <table>
> <caption><h2>Table Caption/Heading</h2></caption>
>
> This is valid HTML and I'm not aware of any downside to doing this.
>
> Jared
> > > http://webaim.org/discussion/archives
> > > > > >