Designing data tables: sorting, filtering, alignment and responsive behavior
Data tables are some of the most-used and least-loved components in business software. A few principles make them far easier to scan and work with.
Alignment
- Left-align text columns.
- Right-align numbers so digits line up, ideally using tabular figures.
- Align column headers with their content.
Density and readability
- Comfortable row height, with an optional compact mode for power users.
- Subtle row dividers or zebra striping, not heavy borders on every cell.
- Truncate long text with a tooltip or expandable row rather than letting rows grow unpredictably.
Interaction
- Sorting: clear sort indicators in headers; one primary sort column at a time is easiest to understand.
- Filtering: visible active filters with a quick way to clear them.
- Selection: checkboxes for bulk actions, with a clear count of selected rows.
- Row actions: keep frequent actions visible, move rare ones into an overflow menu.
- Pagination vs infinite scroll: pagination is easier for finding your place again; virtualized scrolling suits very large datasets.
Responsive strategies
- Horizontal scrolling with a sticky first column
- Hiding lower-priority columns on smaller screens
- Converting rows into stacked cards on mobile
Accessibility
- Use real table markup with header cells so screen readers announce context.
- Ensure sorting and filters are keyboard operable.
What is the hardest table you have designed? Cards on mobile, or horizontal scroll?
Comments · 4
Right-align numbers so decimal places line up, and use tabular figures if your font supports them. It makes columns scannable at a glance.
Row height and zebra striping both matter more than people think. Light separators and generous padding stop a dense table from becoming a wall of text.
What's the best way to show a table on a phone? Cards, horizontal scroll, or hiding columns?
Depends on the data. Cards work for a few key fields, horizontal scroll for dense data, and hiding low-priority columns for most others. Keep the key identifier pinned.