Which tag is used to add a caption to a table?

Learn web design with our comprehensive test guide. Improve your skills with flashcards and multiple choice questions. Each question includes hints and explanations. Get ready to ace your exam!

Multiple Choice

Which tag is used to add a caption to a table?

Explanation:
The caption element is used to add a caption to a table. Placing it as the first child of the table provides a textual label for the table that screen readers announce, improving accessibility. By default, browsers render the caption above the table, though you can position it with CSS if needed. The table element itself defines the grid of rows and cells; figcaption is meant for figures (like images) tied to a figure container, and legend is used with fieldsets in forms. So the caption element is the correct choice because it specifically labeled a table and carries semantic meaning for accessibility and document structure.

The caption element is used to add a caption to a table. Placing it as the first child of the table provides a textual label for the table that screen readers announce, improving accessibility. By default, browsers render the caption above the table, though you can position it with CSS if needed. The table element itself defines the grid of rows and cells; figcaption is meant for figures (like images) tied to a figure container, and legend is used with fieldsets in forms. So the caption element is the correct choice because it specifically labeled a table and carries semantic meaning for accessibility and document structure.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy