Table in a figure - use an inscription or figcaption?

With the advent of HTML5, I start using figure to wrap images and tables, among other things. So far, I have used the table caption element to indicate a table. However, figcaption can be used to indicate the contents of a figure. It seems that in the case of a table inside the figure, there are two elements that serve more or less the same purpose.

On the one hand, caption specific for describing the purpose of a table; figcaption , on the other hand, figcaption bit wider, but applies to the table, as well as to another image of the figure.

Would it be appropriate to use figcaption to indicate tables in figures, if nothing more than consistency with other numbers containing different elements?

+6
source share
1 answer

From the WHATWG spec :

When a table element is the only content in a figure element other than figcaption, the title element should be omitted in favor of figcaption.

And while they are currently matching, here is just in case a link to the W3C Editor Draft .

+6
source

Source: https://habr.com/ru/post/916022/


All Articles