Data table

What makes a data table usable - and when shouldn't I use one?

A data table organises records in rows and columns to let users scan, compare and reorder by any field. Its strength lies in alignment: shared columns let the eye move straight down a value to compare like with like, and sorting lets you reorder the whole set to answer 'which is biggest, newest, cheapest?' In one click.

Also known as: data table, data grid, sortable table

Prefer to watch? Watch the recap 0:31

The demo

Five teammates and their scores. Click any column heading to sort the whole table by it - and watch how the aligned columns let you compare and rank at a glance.

What this demo shows (text version)

A table lists five teammates with three columns: name, role and score. Clicking a column heading sorts every row by that field; clicking the same heading again reverses the direction, and the active column shows which way it's sorted. The score column is right-aligned so the numbers line up and their sizes compare straight down the column.

That's what a table is for: shared columns let you compare like with like, and a single sort reorders the whole set to rank it - highest score first, say. When the task is to compare records across the same attributes or rank them by a value, a table beats a list; when people mostly read one item at a time, or on a narrow screen where wide tables break down, cards or a list serve better.

A table is worth its space when people need to compare records field by field or reorder them by value - alignment and sorting are its purpose. Make columns sortable with a clear indicator, right-align numbers for clean comparison, keep headers visible when scrolling, and use cards instead when the data is more 'browse' than 'compare' - especially on narrow screens, where wide tables break down.

Tables are for comparing and ranking, not merely listing. If users mostly read one record at a time, or the fields don't line up into meaningful columns, a table's grid is overhead - cards or a plain list serve better. Use the table when "compare these across the same attributes" or "sort by this value" is the actual job.

Small choices decide whether a table is scannable. Right-align numbers and use consistent decimals so magnitudes compare down the column; left-align text; keep the header visible when the body scrolls; and make sortable columns obviously sortable, showing the current sort direction. These aren't polish - they're what makes the column do its job.

The hard case is small screens. A wide table that forces horizontal scrolling or shrinks to illegibility has stopped helping. Prioritise the columns that matter, let the rest collapse into a detail view, or switch to a card layout below a breakpoint - the data's job (compare, rank) matters more than preserving the grid.

Try the hands-on demo at site:uxbyexample.co.uk/watch to see how alignment and sorting make data tables work. When comparing records field by field, tables shine - but cards often win for browsing, especially on narrow screens.

A welcome offer

20% off your first UX by Example PDF

Pop in your email and I'll send you a code for 20% off any product or bundle, then one UX term, explained by example, each week.

One email to confirm it's you. Unsubscribe any time. Privacy.