Present structured data (contribution rates, plan comparisons, fee schedules) in accessible tabular format with responsive behaviour and optional sorting.
Variants
Standard (striped/hover), Responsive stacked (cards on mobile), Sortable
Replaces
N/A — new component
2. Design Tokens
Tables consume these semantic tokens — no component-specific tokens are defined.
Token
Role
--caat-color-border
Cell borders
--caat-color-bg-brand
Header row background (dark variant)
--caat-color-text-heading
Header text colour
--caat-color-bg-subtle
Striped (alternating) row background
--caat-color-state-hover-bg
Row hover background
--caat-color-text / -text-inverse
Cell text on light / dark header
--caat-blue-700
Sortable column header / sort control
--caat-radius
Wrapper border radius
--caat-font-primary
Table font family
3. Authoring Fields
Field
Type
Required
Notes
Caption
Textfield
Yes
Visible table caption describing the data
Header Row
Multifield (cells)
Yes
Column headers — minimum 2 columns
Data Rows
Multifield
Yes
Each row contains a cells multifield matching header count
Caption styling — positioned above table, smaller text
.caat-table--striped
Alternating row background via :nth-child(even)
.caat-table--hover
Row highlight on hover
.caat-table--responsive
Enables responsive behaviour based on chosen mode
.caat-table__sort-btn
Unstyled button inside <th> for sort interaction
.caat-table--stacked
Mobile layout — collapses rows into card-like blocks using data-label attributes
8. Accessibility
Requirement
Implementation
Table identification
Every table must have a <caption> or be linked via aria-labelledby to a visible heading.
Header scope
All <th> elements must include scope="col" (or scope="row" for row headers).
Sortable columns
Sort buttons must use aria-sort with values: none, ascending, descending. Live region announces sort change.
Responsive stacked mode
Uses data-label attributes to maintain header–data relationships when table is linearized on mobile.
Focus management
Sort buttons are keyboard-focusable. Focus remains on button after sort action.
Colour contrast
All text meets WCAG 2.1 AA (4.5:1 minimum) against striped/hover backgrounds.
9. SEO
Use semantic <table>, <thead>, <tbody>, <caption> elements — search engines parse these for structured data.
Caption text should include relevant keywords (e.g., "CAAT DBplus contribution rates").
Avoid rendering tables as CSS grid/flex layouts which lose semantic meaning for crawlers.
Tables presenting pension data may be eligible for rich snippets — ensure content is indexable (not loaded via JS).
10. Analytics
Analytics are captured through the shared data-analytics-component attribute on the component root (emitted automatically) and reported to the central data layer. Event names and payloads follow the organisation's standard analytics schema — defined centrally with the analytics team, not invented per component — so no bespoke tracking is specified here.
Simplified model — shows field intent and Granite UI resource types, not the literal cq:dialog node tree (e.g. select options are authored as child items nodes).
Standard, striped, and hover table variants render with correct styling and spacing.
Responsive stacked mode displays rows as card-like blocks on viewports ≤ 768px, with data-label visible as pseudo-headers.
Horizontal scroll mode shows a scrollbar on overflow without breaking page layout.
Sortable columns toggle between ascending/descending on click; aria-sort updates correctly.
Keyboard navigation works: Tab to sort buttons, Enter/Space to activate sort.
<caption> or aria-labelledby is present on every rendered table.
All <th> elements have scope attributes.
Analytics table-sort event fires with correct column and direction payload.
Colour contrast meets WCAG 2.1 AA on striped and hover backgrounds.
Cross-browser tested (Chrome, Firefox, Safari, Edge) on desktop and mobile.
14. Definition of Done
Area
Done means
Design
Figma component matches this contract. All variants (standard, striped, responsive stacked, sortable) documented. Tokens used — no hard-coded colour values.
Development
AEM component created at caat/components/table. HTL template emits semantic HTML per Section 6. CSS uses design tokens. JS handles sort interaction and fires analytics events. Unit tests pass.
QA
All items in the QA Acceptance Checklist (Section 13) pass. Manual accessibility audit completed. Cross-browser and responsive testing done.
Launch
Component deployed to AEM production. Content authors trained on authoring dialog. Analytics dashboards confirmed receiving table-sort events. Documentation published.