简体   繁体   中英

Best way to give a table a title for accessibility?

I want to give a title or heading to a table. For sighted users this will be hidden as the context is obvious, but for screenreaders what is the best way to mark this up? The table is for opening times so that is the title/ caption/ heading/ etc.

You can use <caption> for a title. Even though the caption tag is with the table element, it accepts block level tags, so people wrap the text in a heading tag. The summary attribute can be used to provide a descriptions. See webUsability's guide about these two topics .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM