Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

tbody

The tbody element groups body rows of a table. Vanilla Breeze adds a hover highlight on rows and supports a striped variant for easier scanning.

Description

The <tbody> element contains one or more <tr> elements that make up the data portion of a table. It should appear after <thead> and before <tfoot> in the source order.

Vanilla Breeze applies a hover highlight on tbody tr rows using var(--color-hover-bg), and supports a data-striped variant that applies alternating background colors to odd rows for easier row tracking.

When to Use

  • Every data table: All tables should use tbody to group data rows
  • Multiple tbody sections: Group related rows for visual or semantic separation (e.g., by department or category)
  • Dynamic content: JavaScript can target tbody directly for adding or removing rows without touching headers or footers

Examples

Basic Table with tbody

A complete table structure with <thead>, tbody, and <tfoot>. Hover over rows to see the built-in highlight.

Striped Rows

Add the boolean data-striped attribute to the <table> element. VB alternates backgrounds on odd visible rows within tbody, making it easier to track data across wide tables. Rows hidden by <data-table> filtering or paging (data-state-hidden, hidden) and expandable detail rows (data-expand-content) are skipped, so the stripes keep alternating.

Row States

tbody rows can carry state information for visual indicators like selection or status.

Density

Adjust cell padding for compact or spacious tables.

CSS Reference

Vanilla Breeze applies these styles to rows within tbody:

Selector Property Purpose
tbody tr:hover --_row-bg: var(--color-hover-bg) Highlights the row under the pointer for easier scanning
table[data-striped] tbody tr:nth-child(odd of …) --_row-bg: var(--color-row-stripe) Alternating backgrounds on visible rows; a text-tinted wash that stays distinct from the hover colour

Accessibility

  • Structural separation: Helps assistive technologies distinguish data from headers and footers
  • Implicit role: tbody has an implicit ARIA role of rowgroup
  • Row headers: When rows have their own headers, use <th scope="row"> in the first cell
  • Stripes are decoration: they help sighted users track wide rows but carry no meaning, and in forced-colors mode they are painted out (rows stay ruled by their borders)

Related

  • <table> - Parent container
  • <tr> - Table rows within tbody
  • <td> - Data cells (primary content of tbody)
  • <th> - Row headers (use scope="row" inside tbody)
  • <thead> - Header row group (appears before tbody)
  • <tfoot> - Footer row group for summaries and totals
  • <data-table> - Enhanced table component with sorting, filtering, and pagination
↑