Skip to content

no captionless tables

Marcos Caceres edited this page Mar 27, 2026 · 2 revisions

no-captionless-tables linting rule

Default: true

Warns when a numbered <table> (with class="numbered") does not have a <caption> as its first child.

Example violation

<!-- BAD: numbered table without a caption -->
<table class="numbered">
  <tr><th>Feature</th><th>Status</th></tr>
  <tr><td>Thing</td><td>Done</td></tr>
</table>

How to fix

<table class="numbered">
  <caption>Feature implementation status</caption>
  <tr><th>Feature</th><th>Status</th></tr>
  <tr><td>Thing</td><td>Done</td></tr>
</table>

How to disable

var respecConfig = {
  lint: { "no-captionless-tables": false },
};

Notes

  • Only applies to <table class="numbered"> — unnumbered tables are not checked
  • The <caption> must be the first child of <table>
  • Captions are required for accessibility and for the auto-generated Table of Tables

Guides

Configuration options

W3C Configuration options

Linting rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

HTML attributes

CSS Classes

Special properties

Clone this wiki locally