Re: Heading inside Caption - all good?

Ran your sample code through the W3C validator:

Document checking completed. No errors or warnings to show.
Source

   1. <!DOCTYPE html>↩
   2. <html lang="">↩
   3. <head>↩
   4. <title>Test</title>↩
   5. </head>↩
   6. <body>↩
   7. <table>↩
   8. <caption><h4>Cat food preferences</h4></caption>↩
   9. <tr><td>foo</td></tr>↩
   10. </table>↩
   11. </body>↩
   12. </html>

I'd do some AT testing to ensure it works as expected, but this does seem
like a viable option.

JF

On Wed, Jul 28, 2021 at 8:41 AM Bristow, Alan <Alan.Bristow@elections.ca>
wrote:

> ​Hi,
>
> With the Content Model in HTML5 for the CAPTION tag being Flow content
> (which includes H1 - H6), I am proposing to title TABLES as follows:...
>
> <table>
> <caption><h4>Cat food preferences</h4></caption>
> ...
> </table>
>
> ...rather than a H# tag above the  TABLE and a CAPTION inside it (often
> with somewhat duplicated/similar text).
>
> Audio AT users previewing the main areas of a page will then hear a TABLE
> announced (due to the presence of the H# tag), and there is a programmatic
> relationship between title text and the TABLE due to the use of CAPTION.
>
> If you know of any negative impact to the use of H# inside CAPTION I would
> be interested to hear. Thanks.
>
> Cheers,
>
> Alan
>
> -Alan Bristow
> Web Programmer
> Elections Canada
> alan.bristow@elections.ca



-- 
*John Foliot* | Senior Industry Specialist, Digital Accessibility

"I made this so long because I did not have time to make it shorter." -
Pascal "links go places, buttons do things"

Received on Wednesday, 28 July 2021 13:35:23 UTC