DEV Community

Discussion on: HTML Elements, the `caption` disagreement

Collapse
 
alohci profile image
Nicholas Stimpson • Edited

There's a few points here.

  1. Yes, Firefox doesn't support multiple captions. It should, CSS 2.1 has been clear about this since 2006.. Still, Chrome doesn't implement everything in CSS 2.1 either. They'll always be bugs. I guess. Table layout is notorious, it's apparently a viper's nest of strange and often poorly documented behaviours, and browser maintainers don't want to touch it, nor do spec writers want to try and sort it out.

  2. The HTML content model rules, which state that it's only conforming for there to be one caption per table, should not have any impact on how browsers handle mark-up, which is always defined elsewhere.

  3. HTML 4.01 says that one should use the summary attribute for table, not the summary tag (or more correctly, element). The summary attribute was dropped because, since browsers never rendered it visually, it was horribly misused, harming the accessibility it was designed to help. It was felt that putting the information in the caption element, which is rendered visually, would result in a better experience for both sighted and non-sighted users.

  4. The HTML5 specification's HTML syntax parsing rules do not allow the nesting of captions , and I can't find any browser including Chrome, that does nest them. I suggest you recheck that. If you want to find out what browsers actually do with nested captions, you'd need to either use HTML5's XML syntax, or construct the nested captions with JavaScript.

Collapse
 
icyjoseph profile image
Joseph

Ah, somehow I saw the captions being nested, just tried it again and the tree is flattened :) Fixing that up! Thanks for the contribution!