Re: Heading inside Caption - all good?

Hi John,


Thanks, yes it's part of HTML5 now (Content model > Flow content) https://html.spec.whatwg.org/multipage/tables.html#the-caption-element


It's just not something I've seen, even though I have seen the same thing done with LEGEND. I just seems to make good sense to me.


Cheers,


Alan


________________________________
From: John Foliot <john@foliot.ca>
Sent: Wednesday, July 28, 2021 9:34 AM
To: Bristow, Alan
Cc: w3c-wai-ig@w3.org
Subject: Re: Heading inside Caption - all good?

Ce message a été envoyé par un expéditeur externe. Veuillez faire preuve de prudence et ne pas cliquer sur les liens ou ouvrir les pièces jointes à moins de reconnaître l'expéditeur et de savoir que le contenu est sûr.

This message was sent from an external sender. Please exercise caution and do not click links or open attachments unless you recognize the sender and know the content is safe.


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<mailto: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<mailto: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 14:55:44 UTC