<?xml version="1.0" encoding="utf-8"?>

The <caption> tag

The <caption> tag Bad Practice
The <caption> tag Best Practice

You can specify your table's title with the <caption> tag by placing it directly after the start <table> tag. It's a paired tag which means the content goes in between the start tag and the end tag. By default, the caption appears at the top of the table, but you can change its position using CSS.

While the <caption> element is not compulsory, it's crucial for assistive technology users. It helps users identify a table, understand what it's about and decide if they want to read it.

Improve your UX & Product skills with interactive courses that actually work