Tabular Numerals
A price table and live counter in proportional versus tabular figures: columns align, numbers stop jittering.
AI prompt
Typography specimen showing a small price table with right-aligned amounts, 1,111.11 on one row above 888.88 and 12.50 below, in two columns side by side, the left column in proportional figures with the decimal points drifting out of line and the right column in tabular figures with decimals perfectly aligned, faint vertical guide lines through the decimal points, off-white background, near-black type, labels beneath. Negative: decorative fonts, colour, text errors, clutter. Reduced motion: static specimen.About this pattern
Definition
In many fonts the digit 1 is narrower than the digit 8. Proportional figures look natural in running text, but in columns and live counters they make numbers misalign and jitter. Tabular figures give every digit the same width so decimals line up and changing values do not shift the layout.
When to use it
- Use font-variant-numeric: tabular-nums for tables, prices, timers, scores and stats.
- Use proportional figures in body text and large display numbers.
- Right-align numeric columns and keep the same number of decimals.
- Check that your font actually has tabular figures; many do, a few do not.
What the controls do
- Two figure styles, a Live update switch and guides.
Motion & timing
- The live counter updates every 400ms.
- Reduced motion: the counter does not update on its own.
Tips & variations
- Apply tabular figures to counters that change, so the width does not twitch.
- Include units outside the number so alignment is not broken.
Code of this live preview
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Figures"><button data-p="0" aria-pressed="true">Proportional</button><button data-p="1" aria-pressed="false">Tabular</button></div><div class="tb" id="tb"><div><span>Coffee</span><b>1,111.11</b></div><div><span>Lunch</span><b>888.88</b></div><div><span>Taxi</span><b>12.50</b></div><div><span>Books</span><b>4,017.10</b></div><div class="tot"><span>Total</span><b>6,029.59</b></div></div><div class="lv">Live: <b id="lv">0.00</b></div><label class="sw"><input id="lp" type="checkbox"> Live update</label></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tb{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:6px 12px;font-family:system-ui,'Helvetica Neue',sans-serif;font-size:15px}.tb div{display:flex;justify-content:space-between;padding:3px 0;border-bottom:1px solid var(--line)}.tb div:last-child{border:0;font-weight:700}.tb b{font-weight:500}.tb[data-t="0"]{font-variant-numeric:proportional-nums}.tb[data-t="1"]{font-variant-numeric:tabular-nums}.lv{font-family:system-ui,'Helvetica Neue',sans-serif;font-size:19px;text-align:right;padding-right:4px}.lv[data-t="0"]{font-variant-numeric:proportional-nums}.lv[data-t="1"]{font-variant-numeric:tabular-nums}.lv b{font-weight:600}.sw{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const tb=document.getElementById('tb'),lv=document.querySelector('.lv'),lb=document.getElementById('lv'),lp=document.getElementById('lp'),bs=[...document.querySelectorAll('#pre button')],calm=matchMedia('(prefers-reduced-motion:reduce)').matches;let p=1,v=1111.11,tm=null;if(calm)lp.disabled=true;
function up(){tb.dataset.t=p;lv.dataset.t=p;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
function tick(){v=[1111.11,888.88,1010.01,777.77,1181.18,808.08][Math.floor(Math.random()*6)];lb.textContent=v.toFixed(2);}
lp.addEventListener('change',()=>{clearInterval(tm);if(lp.checked)tm=setInterval(tick,400);});
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));lb.textContent=v.toFixed(2);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Tabular Numerals — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tb{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:6px 12px;font-family:system-ui,'Helvetica Neue',sans-serif;font-size:15px}.tb div{display:flex;justify-content:space-between;padding:3px 0;border-bottom:1px solid var(--line)}.tb div:last-child{border:0;font-weight:700}.tb b{font-weight:500}.tb[data-t="0"]{font-variant-numeric:proportional-nums}.tb[data-t="1"]{font-variant-numeric:tabular-nums}.lv{font-family:system-ui,'Helvetica Neue',sans-serif;font-size:19px;text-align:right;padding-right:4px}.lv[data-t="0"]{font-variant-numeric:proportional-nums}.lv[data-t="1"]{font-variant-numeric:tabular-nums}.lv b{font-weight:600}.sw{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Figures"><button data-p="0" aria-pressed="true">Proportional</button><button data-p="1" aria-pressed="false">Tabular</button></div><div class="tb" id="tb"><div><span>Coffee</span><b>1,111.11</b></div><div><span>Lunch</span><b>888.88</b></div><div><span>Taxi</span><b>12.50</b></div><div><span>Books</span><b>4,017.10</b></div><div class="tot"><span>Total</span><b>6,029.59</b></div></div><div class="lv">Live: <b id="lv">0.00</b></div><label class="sw"><input id="lp" type="checkbox"> Live update</label></div>
</div>
<script>
const tb=document.getElementById('tb'),lv=document.querySelector('.lv'),lb=document.getElementById('lv'),lp=document.getElementById('lp'),bs=[...document.querySelectorAll('#pre button')],calm=matchMedia('(prefers-reduced-motion:reduce)').matches;let p=1,v=1111.11,tm=null;if(calm)lp.disabled=true;
function up(){tb.dataset.t=p;lv.dataset.t=p;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
function tick(){v=[1111.11,888.88,1010.01,777.77,1181.18,808.08][Math.floor(Math.random()*6)];lb.textContent=v.toFixed(2);}
lp.addEventListener('change',()=>{clearInterval(tm);if(lp.checked)tm=setInterval(tick,400);});
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));lb.textContent=v.toFixed(2);up();
</script>
</body></html>