WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Using Aria within a table to indicate that a cell is highlighted

for

From: Birkir R. Gunnarsson
Date: Jul 4, 2022 7:49PM


You could use heading markup inside the table cell (it may be misuse
of headings in theory but at least it would not break the table.
So you can do:
<td aria-current="true"><h4>value of highlighted cell</h4></td>

There should be a "large text" or "emphasized" text markup that screen
readers can pick up and support (incluidng navigation). While HTML is
packed full of semantic text elements (<em> <strong> etc. etc.) there
is virtually no screen reader support for them.
There is slight hope that ARIA 1.2 text semantic roles may get better
support, but I doubt it (after all there's still virtually 0 support
for the values of aria-haspopup even if it's been out there since
2018).
Again, technically you should be able to use aria-roledescription here
<td aria-roledescription="highlighted cell">value of higlight
cell</td> but it would likely not work.

Another hacky idea .. if the table is all static elements (no links or
buttons etc.) you could put tabindex="0" on the highlighted table
cell, so pressing the tab key with focus on the previous focusable
element before the table would take you to the highlighted cell.
But these are all hacks.
Implementing a skip link, button, or keyboard shortcut is probably the
best way to go.
Tht shortcut must be documented.

On 7/4/22, David Engebretson Jr. < <EMAIL REMOVED> > wrote:
> I agree that documentation is going to be really important. Would that
> documentation be best in the table legend or in a paragraph before the
> table?
>
> I think defining a shortcut key, like Glen suggests, could add development
> overhead that could be avoided as user agents and assistive technologies
> develop over the years ahead. Too many possibilities for key conflicts in
> the future.
>
> I, personally, like the idea of making a really descriptive skip link to the
> data cell that is visually highlighted. I still haven't seen any code from
> Geethavani.Shamanna so I don't have any context to the problem. I'm just
> assuming that there is one highlighted data cell the user should obtain
> focus to. All assumptions I've made from their original email.
>
> Speaking of focus: could the user find focus in that cell with a tabindex
> set on that data cell? Then an aria-label for screen readers and plenty of
> other visual goodies for visually oriented folks using assistive
> technologies other than screen readers and/or keyboard only users of course.
> I guess that, since you'll need to have an ID for the skip link, you won't
> need to modify the tab order with tabindex. Probably better that way... but,
> if all of the data cells are hyperlinks innately then maybe tabindex is the
> way to go. Hmmm.
>
> Interesting problem. I look forward to hearing more (and seeing some example
> code) from Geethavani.Shamanna!
> David
>
>