On this page
  1. Tables & Media
  2. Contents
  3. Accessible Data Tables
  4. Images, Figures, Audio & Video

Tables & Media

Prev: Forms & Inputs | Up: elements | Next: Interactive & Scripting
Rel: Media & Responsive Images, Box Model & Sizing
Ref: MDN Web Docs — HTML Elements
Tags: #public #web #html #elements #media


Contents


Accessible Data Tables

Use <caption>, <thead>, <tbody>, and <th scope="col|row"> so screen readers announce headers for every cell.

<table>
  <caption>Quarterly Metrics</caption>
  <thead>
    <tr>
      <th scope="col">Quarter</th>
      <th scope="col">Users</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Q1</th>
      <td>12,400</td>
    </tr>
  </tbody>
</table>

Images, Figures, Audio & Video

<figure>
  <img src="chart.webp" alt="Monthly active users rising 18%" width="640" height="360" loading="lazy" />
  <figcaption>Active user growth across Q1–Q4.</figcaption>
</figure>

Linked from

Related notes