A10

Warning

Accessibility

A10 — A table with no header row

A Table with no Table.Head.

What the compiler said

warning[A10]: Table has no header row (`Table.Head`) --> src/App.wf:3:5 | 3 | Table(caption: "Prices") { Table.Body { Table.Row { Table.Cell("Pen") Table.Cell("2") } } } | ^^^^^ = help: Add one: `Table { Table.Head { Table.Row { Table.Cell("Name") } } … }` = docs: https://webfluent.monzeromer.dev/errors/A10

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { Heading("Table").h1 Table(caption: "Prices") { Table.Body { Table.Row { Table.Cell("Pen") Table.Cell("2") } } } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { Heading("Table").h1 Table(caption: "Prices") { Table.Head { Table.Row { Table.Cell("Item") Table.Cell("Price") } } Table.Body { Table.Row { Table.Cell("Pen") Table.Cell("2") } } } }

Put the first row in Table.Head, so its cells are <th scope="col">.

Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).

lints may lower it:

"lints": { "A10": "off" } // wf-allow(A10)