All work
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.

Fictional transaction ledger with sortable columns
Annual auditPending$1,650.00
Hardware repairPaid$310.00
Email deliveryPaid$54.00
Design tool seatsPending$195.00
Object storagePaid$76.50
Duplicate chargeRefunded$120.00
Contractor invoicePaid$2,400.00
Analytics add-onPending$120.00
Domain renewalPaid$32.00
Workspace seatsPaid$480.00

Sort by any column. Equal values keep their original order.

Talk about a project