Re: Alt text on HTML tables

Subject: Re: Alt text on HTML tables
From: dick -at- rlhamilton -dot- net
To: TECHWR-L <techwr-l -at- lists -dot- techwr-l -dot- com>
Date: Mon, 12 Jun 2023 22:13:03 +0800

Hi Greg,

Thanks for following up on this. For this project, I did two things. For tables that had sample data, I took a screenshot of the table, then in the alt text, I described the column and row headings and said the data shown was sample data.

For a few tables that had real data, but in a complex format, I redid the ebook table as one or more lists. I think that may work better for all readers, since complex tables can be tough for anyone to read on a phone or small tablet.

In the future, your solution sounds like an excellent one for the first case.

Thanks,
Richard

> On Jun 12, 2023, at 20:35, Sweet, Gregory P (HEALTH) <gregory -dot- sweet -at- health -dot- ny -dot- gov> wrote:
>
> ï
> Sorry to be dragging up a stale thread, but as I am catching up on the list, Iâve noticed that you did not get a good semantic reply to your question.
>
> The answer is to use the <caption> element directly after the <table> element to title and describe the table for all users.
>
> <table>
> <caption> My example table </caption>
> âother stuffâ
> </table>
>
> If you truly only want the content to be visible to screen readers you can add an âsr-onlyâ class to your stylesheet so that the text is there for screen readers to see but hidden from all others.
>
> <style>
> .sr-only {
> position: absolute;
> top: -30em;
> }
> </style>
> <table>
> <caption> My example table<span class=âsr-onlyâ>, This table does not contain real data and can be ignored. It presents information in the following formatâ</span></caption>
> âother stuffâ
> </table>
>
> Lastly you can apply aria-label, aria-labeledby, or aria-describedby properties to label and describe the table. -label labels the table directly. -labeledby and -describedby reference another element on the page (usually by id) to provide a label or description. -label and -labeledby turn the caption into the default description. Aria cardinal rules prefer the native html method of a <caption> visible to everyone. See:https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/
>
> Cheers!
>
> Greg
-------
-------
XML Press
XML for Technical Communicators
http://xmlpress.net
hamilton -at- xmlpress -dot- net



^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Visit TechWhirl for the latest on content technology, content strategy and content development | https://techwhirl.com

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-leave -at- lists -dot- techwr-l -dot- com


Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
http://www.techwhirl.com/email-discussion-groups/ for more resources and info.

Looking for articles on Technical Communications? Head over to our online magazine at http://techwhirl.com

Looking for the archived Techwr-l email discussions? Search our public email archives @ http://techwr-l.com/archives


Previous by Author: Re: Aw: Re: AI-based writing assistants
Next by Author: Aw: Sidetracked: AI-based writing assistants
Previous by Thread: Re: Alt text on HTML tables
Next by Thread: Wisi: Turn Notion Wiki into Documentation!


What this post helpful? Share it with friends and colleagues:


Sponsored Ads