WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Using the Summary attribute in tables

for

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

From: Geethavani.Shamanna
Date: Wed, Jul 20 2022 10:13AM
Subject: Using the Summary attribute in tables
No previous message | Next message →

Hello all,

I recently came across a WAI tutorial on tables recommending the use of the Summary attribute to include table description. Is the Summary attribute still in use? If it has been deprecated, what is the best alternative to add table descriptions?
Adding a description via a heading above or below the table won't be very useful as it won't be directly associated with the table.

Many thanks.
Geetha

From: glen walker
Date: Wed, Jul 20 2022 11:02AM
Subject: Re: Using the Summary attribute in tables
← Previous message | Next message →

Correct, the summary attribute was deprecated in HTML 5. Instead you
should use the <caption> element inside a <table>.

Most (all?) screen readers use the caption as the accessible name of the
table so that if I navigate using the T shortcut key, the caption will be
read.



On Wed, Jul 20, 2022 at 10:14 AM Geethavani.Shamanna <
= EMAIL ADDRESS REMOVED = > wrote:

> Hello all,
>
> I recently came across a WAI tutorial on tables recommending the use of
> the Summary attribute to include table description. Is the Summary
> attribute still in use? If it has been deprecated, what is the best
> alternative to add table descriptions?
> Adding a description via a heading above or below the table won't be very
> useful as it won't be directly associated with the table.
>
> Many thanks.
> Geetha
>
>
> > > > >

From: Geethavani.Shamanna
Date: Wed, Jul 20 2022 11:33AM
Subject: Re: Using the Summary attribute in tables
← Previous message | Next message →

Hi Glen,

The Caption attribute is already being used in tables. However, if the table description is a couple of sentences or a paragraph long, where does that go? Was the Summary attribute replaced with another one in HTML 5?

Thanks.
Geetha

From: Jeremy Echols
Date: Wed, Jul 20 2022 12:50PM
Subject: Re: Using the Summary attribute in tables
← Previous message | Next message →

I believe I've seen it recommended to use aria-describedby pointing to a separate element that contains your summary text. That way you get the general functionality of a summary element, it's still visible to sighted users, etc.

From: Birkir R. Gunnarsson
Date: Wed, Jul 20 2022 2:53PM
Subject: Re: Using the Summary attribute in tables
← Previous message | Next message →

Caption maps to a table's accessible name, you can also use aria-label
(for a screen reader only name) or aria-labelledby (if the table is
labeled by a heading above it). Tables should have an accessible name,
but it's not a must.

summary (wen it existed) maps to a table's accessible description. If
the description text is short (1 or 2 sentences, no lists or links or
other embedded elements) you can linked to it from the table using
aria-describedby. The text can be visible to all or visually hidden
(visible only to a screen reader user).

<div class="sr-only" id="t1Desc">table summary content goes here</div>
<table aria-describedby="t1Desc">
...
</table>

If the description is more complex, e.g. you may have to click a
button in the description to make the table configuration more
accessible, or something like that, create a short description for the
table that tells user where they can find the longer description,
something like "navigate to the next h3 heading for a full
description" and use aria-describedby on the table to point to the
short description text.

You do this because accessible description text is announced as one
string, there is no mention of interactive elements, so an accessible
description must be short, simple, and to the point.



On 7/20/22, Jeremy Echols < = EMAIL ADDRESS REMOVED = > wrote:
> I believe I've seen it recommended to use aria-describedby pointing to a
> separate element that contains your summary text. That way you get the
> general functionality of a summary element, it's still visible to sighted
> users, etc.
>
>

From: Geethavani.Shamanna
Date: Fri, Jul 22 2022 5:01AM
Subject: Re: Using the Summary attribute in tables
← Previous message | No next message

Thanks Birkir, this is very useful - just what I needed.

Geetha