Align numbers with tabular-nums

3 min read, 3 skills

Most UI fonts use proportional digits: a 1 is narrower than an 8. In running text that looks good. In a column of prices, a timer, or a live counter it makes numbers wobble and stops the decimal points from lining up.

font-variant-numeric: tabular-nums switches to fixed-width digits that the font already ships. In Tailwind it is tabular-nums. Apply it to table cells, stats, countdowns, and anything that updates in place.

csstd, .stat, time { font-variant-numeric: tabular-nums; }

Right-align numeric columns so the place values stack, and keep the unit in the header instead of repeating it in every cell.