The snippet library.
Small, practical examples. Search by task or narrow things down below.
Associate a data cell with explicit table headers
HTML: The headers attribute lists header IDs for a more complex cell association.
HTML✓ Tested
Continue an ordered list at a chosen number
HTML: The start attribute controls the initial ordinal without changing item text.
HTML✓ Tested
Count an ordered list downward
HTML: The reversed attribute changes the native numbering direction.
HTML✓ Tested
Identify headers for individual table rows
HTML: Scope row associates the first header cell with the data cells in that row.
HTML✓ Tested
Represent a hierarchy with nested lists
HTML: Place the nested list inside its parent list item to preserve the hierarchy.
HTML✓ Tested
Restart numbering at an individual list item
HTML: A value on one ordered-list item sets its ordinal and affects following items.
HTML✓ Tested
Separate table headings data and totals
HTML: Thead, tbody, and tfoot group rows according to their purpose.
HTML✓ Tested
Set consistent widths for table columns
HTML: A colgroup applies presentation to whole columns without repeating styles on every cell.
HTML✓ Tested
Span a group header across several rows
HTML: Rowspan can label a group of related rows without repeating the label.
HTML✓ Tested
Span one header across several columns
HTML: Colspan lets a heading cover a defined number of columns in the table grid.
HTML✓ Tested