Sortable table
Requirements: a plain, semantic <table> whose column
headers become buttons that sort the rows. The current sort is exposed with
aria-sort on the <th>, one polite
role="status" message is announced per sort, and focus stays on the header
button.
Platform features: Invoker Commands (commandfor +
custom --sort commands, handled by one command listener on the
table, with a click fallback where unsupported), element-scoped View
Transitions with view-transition-name: match-element for row animation, and moveBefore() to reorder the existing
<tr> nodes (falling back to append()). The table scrolls
horizontally in a wrapper on narrow screens, and the animation is disabled under
prefers-reduced-motion.
| Symbol | ||||
|---|---|---|---|---|
| Mercury | Terrestrial | 4,879 | 0 | ☿ |
| Venus | Terrestrial | 12,104 | 0 | ♀ |
| Earth | Terrestrial | 12,742 | 1 | ⊕ |
| Mars | Terrestrial | 6,779 | 2 | ♂ |
| Jupiter | Gas giant | 139,820 | 95 | ♃ |
| Saturn | Gas giant | 116,460 | 146 | ♄ |
| Uranus | Ice giant | 50,724 | 28 | ⛢ |
| Neptune | Ice giant | 49,244 | 16 | ♆ |