TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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