03Fictional studySortable table
Ledger View
Problem
A ledger is read by comparison: this amount against that date, this status against the next. When columns cannot be sorted, people scroll and remember instead. When sorting is added carelessly, equal values jump around and the table stops being trustworthy.
Approach
- Sort on every column, with the active column and direction visible in the header.
- Keep the sort stable: equal values fall back to the original row order.
- Put aria-sort on the header cell and use real buttons, so the state is announced and keyboard operable.
- Right-align amounts with tabular figures, so digits line up when scanning a column.
Outcome
The table can be reordered in four ways and still reads as the same table: stable rows, aligned amounts and a header that states the current sort. Comparison no longer depends on memory.
No client, product data or performance figure is represented in this study.
Try it
Ten fictional transactions are sorted in the browser. No account, currency conversion or server call is involved.
| Annual audit | Pending | $1,650.00 | |
| Hardware repair | Paid | $310.00 | |
| Email delivery | Paid | $54.00 | |
| Design tool seats | Pending | $195.00 | |
| Object storage | Paid | $76.50 | |
| Duplicate charge | Refunded | $120.00 | |
| Contractor invoice | Paid | $2,400.00 | |
| Analytics add-on | Pending | $120.00 | |
| Domain renewal | Paid | $32.00 | |
| Workspace seats | Paid | $480.00 |
Sort by any column. Equal values keep their original order.