This is Stashling’s sign-up form, as Module 9 left it, right after someone pressed “Create account” with every field empty. The page is 1280 pixels wide, in the light theme.

Figure 1: the sign-up form after a submit attempt. The browser’s bubble is the only sign of a problem, and it names one field.
And this is the snapshot table on the settings page of the same site.

Figure 2: the snapshot table at 1280 pixels. The numbers start on one edge and end wherever their digits run out.
A reader would say the form keeps its rules a secret, and the table makes you read every number twice. You don’t learn that the username must be lowercase until the form refuses it, one bubble at a time. In the table, 845 KB looks larger than 3.1 MB.
This module is about forms, data tables and the words inside them. First it covers where labels and hints go, how wide a field should be, and which fields to mark. Then it covers when an error should appear and what it should say. For tables, it covers how numbers line up, how dense rows should be, and what an empty table says.
After this module, you can:
- place labels, hints and an “(optional)” mark so that people know what to type before they type, and size each field to its answer
- give fields an edge and checkboxes a size that pass WCAG 1.4.11 and 2.5.8, and show the ratios you computed
- choose when errors appear, say which sources support each choice, and show each error next to its field with
:user-invalid - write hints, error messages and button labels that tell people what to do
- line up a table’s numbers with right alignment, tabular figures and one unit per column, keep its rows readable on a phone, and design its empty state
To follow along, start from the module-09 folder of the course repository, github.com/vespaiach/web-design-course. Open signup.html and settings.html in Chrome at 1280 pixels wide.
A form that hides its rules, and a table that hides its sizes
Pause and predict: in
module-09, type “Dana” as the username, fill in every other field, and press “Create account”. What happens? Then look at Figure 2 and find the largest “Added” value.
Answer
Chrome accepts “Dana” and sends the form, although the pattern attribute asks for lowercase letters. The section “Say the rule before anyone breaks it” shows why.
The largest “Added” value is 1.2 GB, in the sixth row. Your eye goes first to 210.6 MB, because it’s the longest text in the column. But the units differ from row to row, so the length of the text says nothing about the size.
Both pages work, but each one leaves the reader a step that the page could have done, such as finding the rules or converting the units.
Labels above their fields
In Figure 1, the labels sit to the left of the fields, aligned right. Module 7 built that layout for wide screens with a container query. The question is where a label should go so that people read it and the field together.
Eye-tracking studies measure two things. A fixation is a moment when the eye rests on one spot, usually a fraction of a second. A saccade is the fast jump of the eye between two fixations.
The most quoted source for labels above fields is a small test by Matteo Penzo (Penzo, UXmatters, 2006). It compared four versions of a short form. The saccade from label to field took about 500 ms with left-aligned labels beside the fields, and about 50 ms with labels above.
But the evidence is weak. The article doesn’t say how many people took part, and it reports no statistics. The forms were short and unstyled, and the test measured speed and gaze, not understanding.
A stronger study tested 20 form guidelines together (Seckler and others, CHI 2014). 65 people filled in three real newspaper sign-up forms, either the original or a version improved with all 20 guidelines. Guideline 5 was “place the labels above the corresponding input fields”.
With the improved forms, 78% of people sent the form correctly on their first try, against 42% with the originals. That pooled figure is our arithmetic from the paper’s table (76 of 98, and 41 of 97). The eye tracker showed longer saccades and more fixations with the original side-by-side labels.
The limit is in the design of the study. All 20 guidelines changed at once, so it can’t say how much the labels alone did.
Two practitioner sources agree for phones. Baymard tested 18 mobile shopping sites and found that labels above let the field use the full width and show the whole entry (Baymard, 2013). The cost was more scrolling, which their testers didn’t mind. NN/g advises labels above for phones and short desktop forms, and accepts labels beside fields on very long desktop forms (NN/g, 2016).
One small study disagrees (Das and others, NordiCHI 2008). Its abstract recommends right-aligned labels, at least for forms with several columns. We could read only the abstract.
Stashling’s form is short, has one column, and is used on phones. Every source above that covers that case says labels above. So the lab deletes the container query, and the labels stay above at every width.
A label above its field brings a new problem, because it now sits between two fields. So Module 2’s rule applies, space inside a group smaller than space between groups. The lab keeps 4 px between a label and its field and raises the space between rows from 10 px to 16 px:
/* excerpt from signup.css */
/* Each label above its field, and more space between fields than inside one */
.signup-form .row {
display: grid;
gap: var(--space-1);
margin-bottom: var(--space-inside);
}
The button moves to the left edge too, because .actions { text-align: right; } goes. The label, the field and the button now share one left edge, so the eye moves down a single line.
Pause and predict: the lab makes no other change. Which field will the browser’s bubble point to after a submit attempt?

Figure 3: labels above their fields, and one left edge for labels, fields and the button.
Answer
Still Full name. The browser checks fields in source order and points at the first one that fails. No field’s rules changed.
Rule: In a one-column form, put each label above its field, closer to its own field than to the field above.
Say the rule before anyone breaks it
The username has a rule, written in signup.html:
<!-- excerpt from signup.html in module-09 -->
<input type="text" id="username" name="username" pattern="[a-z0-9-]{3,20}" required>
Pause and predict: does Chrome accept “Dana” as a username here? Read the pattern as a regular expression before you answer.
Open the page, open the DevTools Console, and run this line:
const u = document.querySelector("#username"); u.value = "Dana"; u.checkValidity();
Chrome 157 returns true and logs this error, shortened here:
Pattern attribute value [a-z0-9-]{3,20} is not a valid regular expression:
... Invalid regular expression: /[a-z0-9-]{3,20}/v: Invalid character class
So the pattern never runs, and MDN explains why (MDN, pattern). Browsers compile pattern with the v flag, which changes how character classes work. Under v, a hyphen meant as a literal character must be escaped, and the spec changed from the u flag in mid-2023. An invalid pattern isn’t applied at all.
So the form had a rule that nobody could see, and the browser didn’t check it either. The fix is one backslash:
<!-- excerpt from signup.html -->
pattern="[a-z0-9\-]{3,20}"
Now the rule needs to be on the page. Hint text is a short line under a label that tells people what the field accepts before they type. The username and the password each get one, linked to the field with aria-describedby so that a screen reader reads it with the label:
<!-- excerpt from signup.html, as Step 2 of the lab leaves it -->
<label for="username">Username</label>
<p class="hint" id="username-hint">Use 3 to 20 lowercase letters, numbers or hyphens</p>
Google’s summary of the 2014 study names format rules stated up front as the guideline with the most influence (Google Research blog, 2014). GOV.UK places hints between the label and the field (GOV.UK, Text input).
A placeholder looks like a cheaper place for the same words, but NN/g and GOV.UK list its problems (NN/g, 2014). It disappears when you type, so you have to remember it. It hides what you entered, and the browser’s default placeholder color often fails contrast. Not every screen reader announces it.
The hint uses --color-muted, which is 6.58:1 on white and 6.38:1 on the dark surface. Both pass the 4.5:1 that WCAG 1.4.3 asks for text.
Required or optional
The form had five required fields, but nothing on the page said so. The sources disagree on how to mark them:
| Source | Marks | Evidence |
|---|---|---|
| NN/g, 2019 | An asterisk on every required field, red as people expect | Expert guidance, no study |
| Seckler and others, 2014, guideline 4 | Asterisks and color on required fields | One guideline among 20 tested together |
| GOV.UK, Question pages | “(optional)” on optional fields; “Never mark mandatory fields with asterisks” | Practice from GOV.UK services, no published numbers |
| Baymard, 2018 | Both: an asterisk on required and “(optional)” on optional | Checkout testing since 2010, reconfirmed in 2021 |
| Nielsen, 2025 | Asterisks by default; only “(optional)” when most fields are required | Convention, citing Baymard |
Baymard’s numbers are the only measured ones. On sites that marked only optional fields, 32% of their test users hit an error from a required field they missed. On sites that marked only required fields, users filled in optional fields they didn’t need to, or gave up. Baymard also found that a single note such as “All fields are required” was overlooked.
Baymard’s finding comes from checkouts and long account forms. But the same article says short sign-up and contact forms are “much less affected”.
First, the lab decides that Stashling doesn’t need a full name to create an account. That leaves one optional field among five, so the lab follows GOV.UK and Nielsen’s rule for mostly required forms. It writes “(optional)” in one label and adds no asterisks.
The cost is Baymard’s 32%: people may assume that unmarked means optional. But on a five-field form, the hint lines and the error messages cover that case. A long checkout would justify Baymard’s double marking. Every required field keeps its required attribute, because screen readers announce it and :user-invalid depends on it.
<!-- excerpt from signup.html -->
<label for="name">Full name (optional)</label>
<input type="text" id="name" name="name" autocomplete="name">
Let the browser fill in what it knows
Two WCAG success criteria ask the form to help with typing. 1.3.5 Identify Input Purpose (AA) asks fields about the user to expose their purpose in code, and HTML’s autocomplete attribute does that (Understanding 1.3.5). 3.3.7 Redundant Entry (A), new in WCAG 2.2, asks a form not to make people type the same thing twice in one process (Understanding 3.3.7).
The lab sets autocomplete to name, email, username and new-password, tokens from MDN’s list (MDN, autocomplete). new-password tells a password manager to suggest a new password, not fill in a saved one. MDN shows no Baseline status for the attribute.
The username also gets autocapitalize="none" and spellcheck="false", because a phone keyboard may start a username with a capital letter. But autocapitalize isn’t Baseline in web-features 3.46.0. In a browser without it, the phone may add the capital, and then the error message explains the rule.
Pause and predict: after the hints and the “(optional)” mark, which field does the bubble point to now?

Figure 4: hints under two labels, and one optional field. The bubble moved to Email.
Answer
Email. Full name is no longer required, so an empty Full name passes, and the first field that fails is Email.
Rule: State every rule a field enforces next to its label before anyone types, and mark the few fields that are the exception.
Fields that look like fields and fit their answers
Stashling’s fields still use Chrome’s own styles. That gives them black text and a 2 px inset edge, which differ from the site’s text color and its 1 px borders. Restyling them is easy, but the risk is a restyle that makes the edge too faint.
WCAG 1.4.11 Non-text Contrast asks for 3:1 for the parts of a control that people need to see to identify it (Understanding 1.4.11). The edge of an empty text field is such a part, because without it the field is invisible.
We read Chrome 157’s default edge colors with getComputedStyle and computed the ratios with the WCAG function from Module 6:
// excerpt from color-calc/m10/m10.mjs: the full script prints every ratio in this module
const hex2rgb = h => [1, 3, 5].map(i => parseInt(h.slice(i, i + 2), 16));
const lin = c => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
const lum = h => { const [r, g, b] = hex2rgb(h).map(v => lin(v / 255)); return 0.2126 * r + 0.7152 * g + 0.0722 * b; };
const ratio = (a, b) => { const [hi, lo] = [lum(a), lum(b)].sort((p, q) => q - p); return (hi + 0.05) / (lo + 0.05); };
console.log(ratio("#767676", "#ffffff").toFixed(2)); // 4.54 Chrome's edge, light
console.log(ratio("#bebebe", "#ffffff").toFixed(2)); // 1.86 --color-border, light
console.log(ratio("#5d5d5d", "#ffffff").toFixed(2)); // 6.58 --color-muted, light
| Edge color | Light theme, on #ffffff |
Dark theme, on #222222 |
|---|---|---|
| Chrome 157 default | #767676: 4.54:1 |
#858585: 4.31:1 (3.04:1 on its own #3b3b3b fill) |
--color-border, the cards’ border |
#bebebe: 1.86:1 |
#5d5d5d: 2.42:1 |
--color-muted |
#5d5d5d: 6.58:1 |
#a4a4a4: 6.38:1 |
Chrome’s defaults pass. But the obvious restyle, border: 1px solid var(--color-border), would fail in both themes, because that token was made for cards, which don’t need an edge to be found. So the lab adds a field token that points to the muted color, as Module 9 did for links and focus:
/* excerpt from tokens.css */
--color-field-border: var(--color-muted); /* the edge of a field: 3:1 or more on surface (WCAG 1.4.11) */
One rule in base.css gives every text field and select the same edge, padding and corners as the buttons:
/* excerpt from base.css */
/* Fields: an edge with 3:1 against the page, the theme's colors, the buttons' corners */
input:not([type="checkbox"]),
select {
padding: var(--space-2);
border: 1px solid var(--color-field-border);
border-radius: var(--radius-small);
background: var(--color-surface);
color: inherit;
font-size: var(--step-0);
}
Firefox and Safari draw their own defaults, which we didn’t measure. But the rule replaces them, so the edge ratio is the same in every browser that applies it.
Field width that matches the answer
Every field in Figure 4 is the full width of the form, so a 3-character username gets the same box as an email address. Baymard’s checkout testing found that a field much longer or shorter than the expected answer makes people doubt that they read the label right (Baymard, 2010). The effect was strongest for unfamiliar labels.
Baymard sorts fields into three groups:
- Fixed length, such as a birth year: size the field to that length.
- Variable, with a normal average, such as a name or an email address: give these one shared width.
- Variable, with an unusual average, such as a postal code: give it a width of its own.
NN/g adds the other side of the trade. A field too short to show the whole entry is “extremely error prone”, because people can’t check what they typed (NN/g, 2016). GOV.UK sizes fixed fields in characters and leaves room for the icon a password manager puts inside some fields (GOV.UK, Text input).
The username has at most 20 characters. A ch is the width of the “0” in the current font, as Module 4 explained, so 20ch fits 20 average characters:
/* excerpt from signup.css */
/* A username has at most 20 characters, so its field is 20 characters wide */
.signup-form [name="username"] {
max-inline-size: 20ch;
}
At 1280 the field’s text area is 227 px wide. A 20-character name such as “stashling-backups-01” takes 184 px in Inter, which leaves room for a password manager’s icon. But twenty letter m’s take 315 px, so that rare name scrolls inside the field. These widths come from one run in Chrome 157; yours may differ.
The other fields keep the full width, because email and password are variable with a normal average, and a long password is a good one.
field-sizing: content makes a field grow as you type. It’s Baseline newly available since June 2026, not widely (MDN, field-sizing). Browsers without it keep the field’s normal size, and a fixed width cancels it, so use min-inline-size and max-inline-size with it.
Pause and predict: compare Figure 4 with the next figure. Which differences come from the new rule, and which from the 20ch width?

Figure 5: one edge, padding and radius for every field, and a username field sized to its answer.
Answer
The edges, corners and inner padding come from the new rule in base.css, and the form is a little taller because of the padding. The narrow Username field is the only effect of 20ch.
Rule: Give a field an edge with 3:1 against the page, and a width that matches the answer you expect, with room to see all of it.
When an error should appear
In Figure 5, a submit attempt still shows one bubble on one field. Fix Email, press the button again, and the next bubble appears on Username. Before the CSS, the timing needs a decision, and the sources disagree about it.
Inline validation is checking a field and showing its error next to it while the person is still filling in the form, instead of after they submit. A premature error is an error shown before the person has finished entering the value, such as “invalid email” after the first letter.
There are three main timings:
- Submit only: check every field when the person submits, and show all the errors at once.
- After the field: check a field when the person leaves it, then update its error as they correct it.
- While typing: check on every keystroke.
Luke Wroblewski tested six versions of one sign-up form with the research firm Etre (Wroblewski, A List Apart, 2009). The 22 participants, aged 21 to 49, used every version, and an eye tracker followed them.
Compared with a form that checked only on submit, the best inline version had 22% more successful completions and 22% fewer errors. It was 42% faster and drew 47% fewer fixations, and satisfaction rose 31%. Checking after the field was 7 to 10 seconds faster than checking while typing.
But the test has limits. 22 people saw all six versions, so they learned the form as they went. The article gives percentages without raw counts, and no participant used a screen reader or a magnifier. Simple fields such as a name gained little; fields with strict rules gained most.
Baymard’s recent testing agrees with checking after the field (Baymard, 2024). It also advises removing the error on the keystroke that fixes it. 31% of the sites in their benchmark had no inline validation at all.
GOV.UK takes the other side: “Do not validate when the user moves away from a field” (GOV.UK, Validation). It checks when the person submits, and says early validation causes problems, “especially for users who type more slowly”. The person may leave a field to copy something and come back.
GOV.UK then shows an error summary, a list of every error at the top of the page, each linked to its field, with focus moved to it (GOV.UK, Error summary). It also adds “Error: ” to the page title. Seckler’s guideline 16 agrees with GOV.UK, and says to show errors after the form is sent, all together, inside the form.
NN/g calls premature errors “a hostile pattern” and says leaving a field is not by itself a reason to show one (NN/g, 2023).
| Moment | Submit only | After the field | While typing |
|---|---|---|---|
| You type “dana” in Email | nothing | nothing | Email error |
| You leave Email | nothing | Email error | Email error |
| You come back and finish “dana@example.com” | nothing | the error goes on that keystroke | the error goes on that keystroke |
| You press Tab past Username without typing | nothing | nothing | nothing |
| You press “Create account” | Username error | Username error | Username error |
| Main sources | GOV.UK; Seckler 2014, guideline 16 | Wroblewski 2009; Baymard 2024 | Wroblewski 2009, only for strict rules, with a delay |
The evidence on each side is thin. Wroblewski’s test is the only controlled comparison of timings, and it’s small and 17 years old. GOV.UK reports research from its services but publishes no numbers for this rule.
The lab chooses “after the field”, for three reasons. First, it’s the timing that :user-invalid gives you in CSS, with no script. It also flags only fields the person typed in, never a field they tabbed past, so the most common premature error can’t happen. And the error goes away on the keystroke that fixes it, as Baymard advises.
The cost is GOV.UK’s case, in which someone who leaves a half-typed email to copy the rest sees an error for a moment. The lab also has no error summary, because that needs a script. But with six fields on one screen, every message is visible at once after a submit attempt, which is close to what Seckler’s guideline 16 asks. If your form is long, you’d need the summary.
Rule: Show an error once the person has left the field or tried to submit, never while they type, and remove it once the value is right.
:user-invalid: the browser’s own timing
CSS has had :invalid for years. It matches every field that fails its constraints from the moment the page loads, so an empty required field looks like an error before anyone touches it.
:user-invalid waits, because the HTML standard gives each field a flag called user validity, which is false when the page loads (HTML, form controls). It becomes true when the user commits a change to the field, or when they try to submit the form. :user-invalid matches a field whose user validity is true and that fails its constraints. Resetting the form sets the flag back to false.
“Commits a change” isn’t defined the same way for every control, so we tested it in Chrome 157 with real key and mouse events sent through the DevTools protocol. The script is color-calc/m10/timing.mjs, and these are the results of one run on the lab’s form:
- Clicking a field and pressing Tab without typing: the field doesn’t match.
- Typing “dana” in Email: no match while focus stays in the field.
- Pressing Tab to leave Email: it matches.
- Coming back and typing until the address is valid: the match ends on that keystroke, with focus still in the field.
- Typing 5 characters in Password: no match while you’re in it. At 12 characters it is valid.
- Checking and then unchecking the required checkbox: it matches at once, because a click commits the change.
- Pressing “Create account”: every invalid field matches, focus moves to the first one, and the browser shows its bubble.
Firefox and Safari weren’t tested. :user-invalid and :user-valid are Baseline widely available since May 2026, newly available since November 2023.
The style needs to reach the field’s row, not only the field, so that the message can show. :has() lets a parent depend on a child’s state, and it’s Baseline widely available since June 2026.
Where the message lives
The message has to be written in advance, because CSS can show text but not write it. So each required field gets its message inside its <label>, hidden until the row has an invalid field:
<!-- excerpt from signup.html -->
<label for="email">Email <span class="field-error">Enter an email address in the correct format, like name@example.com</span></label>
/* excerpt from signup.css */
.signup-form .field-error {
display: none;
font-weight: 600;
color: var(--color-danger);
}
.signup-form .row:has(:user-invalid) .field-error {
display: block;
}
/* The message repeats the rule, so the hint steps aside */
.signup-form .row:has(:user-invalid) .hint {
display: none;
}
.signup-form :user-invalid {
border-color: var(--color-danger);
}
The message goes inside the label, not in a paragraph linked with aria-describedby like the hint. A description that points at hidden text still reads that text, so a screen reader would announce the error before anything was wrong. But text inside a label counts toward the field’s name only while it’s shown.
We checked that in Chrome’s accessibility tree with color-calc/m10/ax.mjs. On load, Email’s name is “Email”, and after a submit attempt it’s “Email Enter an email address in the correct format, like name@example.com”. Chrome didn’t mark the text fields as invalid in that tree, so a screen reader hears the message as part of the name, without an “invalid” state. Setting aria-invalid would add that state, but it needs a script. We didn’t run a screen reader.
WCAG asks for three things here. 3.3.1 Error Identification (A) asks that the error be “described to the user in text” (Understanding 3.3.1). 3.3.3 Error Suggestion (AA) asks for the correction when it is known (Understanding 3.3.3). 1.4.1 Use of Color, from Module 9, rules out a red edge alone.
The red edge would fail as a signal on its own. #d02c2a against the normal #5d5d5d edge is 1.28:1 in the light theme, and #ff998d against #a4a4a4 is 1.21:1 in the dark theme. Against the page, the red passes easily, at 5.15:1 and 7.72:1. So the words carry the meaning, and the color helps people who see it.
Pause and predict: in the next figure, every field is still empty after a submit attempt. Which rows show a message, and which do not?

Figure 6: every error at once, each next to its field and in words. The browser’s bubble still appears.
Answer
Email, Username, Password and the checkbox show messages, because each is required and empty. Full name is optional, so it passes, and Plan always has a value. The bubble still points at Email, the first invalid field.
The bubble stays because the form still uses the browser’s validation. Adding novalidate to the form removes the bubbles, but then nothing stops an invalid form from being sent. GOV.UK’s pattern does that with novalidate, a script that stops the submit, and an error summary. If your form is long, that’s the next step; the lab stops here, with no script.
“Create account” stays enabled the whole time. Module 9 set out the debate between disabling a button until the form is valid and explaining the problem when someone presses it. The lab takes the second side, so a press shows every message.
The label approach has a cost on a phone, where the bubble can cover the message under the next label for a few seconds, as it does in Figure 13.
Rule: Put the error in words next to its field, show it with
:user-invalid, and make it part of what a screen reader announces only while it is shown.
Words on buttons and in errors
Microcopy is the short text inside an interface: labels, hints, button labels and error messages. It’s read at the moment someone acts, so each word has to tell them what to do.
GOV.UK’s guidance on error messages comes from testing in its live services (GOV.UK, Error message):
- Say what happened and how to fix it.
- For an empty field, start with “Enter” or “Select”: “Enter your first name”.
- For wrong input, describe the rule: “Enter a first name that is 35 characters or less”.
- Use the label’s words, and the same text in the summary and next to the field.
- Avoid “invalid”, “please”, “sorry”, “forbidden”, “An error occurred” and “This field is required”.
The lab writes one message per field, so each must work for an empty field and a wrong one. GOV.UK’s own example for email does both:
| Field | A generic message | The lab’s message |
|---|---|---|
| Invalid input | Enter an email address in the correct format, like name@example.com | |
| Username | This field is required | Enter a username of 3 to 20 lowercase letters, numbers or hyphens |
| Password | Error 422 | Enter a password of at least 12 characters |
| Terms checkbox | Please accept | Agree to the terms of service to create an account |
The sources disagree on politeness. Seckler’s guideline 14 allows a polite message that apologizes. But GOV.UK avoids “please” and “sorry”, because they add words without adding help. The lab follows GOV.UK, so the messages are plain instructions.
For buttons, NN/g’s guidance is to start with a verb, name the object, and keep to two to four words without articles (NN/g, 2019). The same command keeps the same label everywhere. GOV.UK adds that “Save and continue” should appear only when the button saves (GOV.UK, Button).
Stashling’s buttons already pass: “Create account”, “Save account”, “Save schedule”, “Restore selected” and “Delete repository” each start with a verb and name what they act on. A “Submit” button would say what the form does to the server, not what the person gets. The new button in the empty table, later in this module, says “Back up now”.
Reading level is the one part of this a tool can score, and only partly. WCAG 3.1.5 Reading Level (AAA) asks for a simpler version of text above lower secondary level, and names no formula (Understanding 3.1.5). The W3C chose reading level because it found no way to test “clear writing”. But a formula that counts syllables and sentence length says little about a five-word button.
Rule: Make every error message an instruction that names the fix, and every button label a verb and the thing it acts on.
Numbers that line up
Back to the table in Figure 2. A column of numbers is read in two ways: you compare values down the column, and you look up one value. Both work best when each digit sits under the digit of the same place value, ones under ones and thousands under thousands.
Left alignment breaks that. In the Files column, “128,455” and “0” start at the same edge, so the 0 sits under the hundred-thousands. Right alignment puts the ones digits on one edge, and the length of a number then shows its size.
GOV.UK’s table component says to “align the numbers to the right in table cells” (GOV.UK, Table). The US Web Design System marks numeric cells with right-aligned, tabular classes in its examples (USWDS, Table). Matt Ström adds that each header should follow its column’s alignment (Ström, “Design better data tables”). We found no study behind the rule; it rests on how place values work.
Right alignment alone isn’t enough in most fonts. Proportional figures are digits with different widths, so that “1” is narrower than “0”, which suits numbers inside sentences. Tabular figures are digits that all have the same width, so that columns of numbers line up.
Butterick calls tabular figures “essential” for one purpose, vertically aligned columns (Butterick, Alternate figures). In his test, a line of ten zeros and a line of ten ones of the same length mean that the figures are tabular.
CSS asks for them with font-variant-numeric: tabular-nums, which turns on the font’s OpenType tnum feature (MDN, font-variant-numeric). It’s been Baseline widely available since July 2022. If the font has no tnum, the property does nothing and reports no error, so check the font first.
The lab’s Inter is a subset from Google Fonts, and a subset can drop features. So this script reads the file with the fontTools library:
# excerpt from color-calc/m10/tnum.py: python3 -m pip install fonttools brotli
from fontTools.ttLib import TTFont
font = TTFont("../lab/module-10/fonts/inter-roman-latin.woff2")
gsub = font["GSUB"].table
print(sorted({r.FeatureTag for r in gsub.FeatureList.FeatureRecord}))
It prints ['calt', 'ccmp', 'dnom', 'frac', 'locl', 'numr', 'pnum', 'tnum'], so tnum survived the subset. The full script also prints each digit’s width. By default, Inter’s “1” is 0.407 em wide and its “4” is 0.646 em. With tnum, every digit is 0.648 em, 11.67 px at the table’s 18 px.
Pause and predict: Butterick’s test in the browser. Run this in the Console on
settings.html. What two widths do you expect withnormal, and withtabular-nums?
const s = document.body.appendChild(document.createElement("span"));
for (const v of ["normal", "tabular-nums"]) {
s.style.fontVariantNumeric = v;
s.textContent = "0000000000"; const zeros = s.getBoundingClientRect().width;
s.textContent = "1111111111"; console.log(v, zeros.toFixed(2), s.getBoundingClientRect().width.toFixed(2));
}
Answer
In Chrome 157 at 1280 pixels, normal prints 113.50 and 73.19: the ten ones are 40 px shorter. tabular-nums prints 116.66 and 116.66. Your numbers will differ with another browser or font size, but the two tabular-nums widths should match each other.
The next figure shows why the table needs both changes. It crops the Files and Size columns three times.

Figure 7: the same two columns left-aligned, right-aligned, and right-aligned with tabular figures. Only the last puts every digit under its place value.
The CSS finds the four numeric columns by position, so no HTML changes:
/* excerpt from settings.css */
.settings th,
.settings td {
border: 1px solid var(--color-border);
padding: var(--space-1) var(--space-2);
text-align: start; /* headers too: browsers center them */
}
/* Columns 4 to 7 hold numbers: right-aligned, every digit the same width,
so ones sit under ones. Change the numbers if the columns change. */
.settings :is(th, td):nth-child(n + 4):nth-child(-n + 7) {
text-align: end;
font-variant-numeric: tabular-nums;
}
The cost is in the comment. If you add a column, the numbers in the selector must change. GOV.UK puts a class on every numeric cell instead, which survives new columns but means more markup. The browser centers th by default, so the first rule moves the text headers to the left, over their columns.

Figure 8: numbers and their headers on the right, with tabular figures. The units are still mixed.
Decimals would line up on their points only if every value had the same number of decimal places. CSS Text Level 4 drafts a text-align value that aligns on a character such as “.”, but no browser ships it. In Chrome 157, CSS.supports('text-align', '"."') returns false, and web-features lists no such feature.
Rule: Right-align numbers and their headers, and turn on tabular figures after you check that the font has them.
One unit and one precision per column
In Figure 8, the digits line up, but the sizes still don’t compare. “845 KB” looks longer than “3.1 MB”, and “1.2 GB” looks shorter than both. A column exists to compare values, so every value needs the same unit.
The lab moves each unit into its header and gives every value in a column the same number of decimals, as Ström advises:
| Column | Before | After |
|---|---|---|
| Size | 1.42 GB, 987.3 MB, 76.5 MB, 0 B | Size (GB): 1.42, 0.99, 0.08, 0.00 |
| Added | 18 KB, 845 KB, 210.6 MB, 1.2 GB | Added (MB): 0.0, 0.8, 210.6, 1,200.0 |
| Duration | 1m 9s, 41s, 1h 4m | 0:01:09, 0:00:41, 1:04:00 |
Here 1 GB is 1,000 MB. The duration uses hours, minutes and seconds, so tabular figures line its colons up too.
The cost shows in the first row. The running snapshot added 18 KB, which is 0.0 MB at one decimal, the same as the failed snapshot’s 0 B. So one unit per column trades small values for comparable ones. If small values matter, choose a smaller unit, or show the exact value in a tooltip or a detail page.
Pause and predict: which row added the most data? Find it in Figure 8, then in Figure 9.

Figure 9: one unit per column, in the header, with one precision per column.
Answer
Snapshot 3d81f6e, which added 1.2 GB. In Figure 8 you have to read the units; in Figure 9, 1,200.0 is the longest number in the Added column.
Rule: Give each numeric column one unit, written once in its header, and one number of decimal places.
Rows on a phone, and how dense a table should be
Module 7 put the table in a box that scrolls sideways on a phone. But inside it, the cells still wrap, so a date breaks over four lines and each row is 106 px tall at 390 pixels. One line per row keeps rows short, and the box already scrolls:
/* excerpt from settings.css */
white-space: nowrap; /* one line per row; the box scrolls sideways instead */

Figure 10: at 390 pixels, wrapped cells before and one line per row after. Rows go from 106 px to 33 px.
The cost is that on a phone you see three columns at a time and scroll for the rest. For tables wider than the screen, NN/g advises freezing the header row or the first column, so that people keep their place (NN/g, 2022). It also advises a readable identifier in the first column. Sticky positioning can freeze the first column and is Baseline widely available; the lab leaves that for later.
Row height sets a table’s density, which Module 2 defined as how much content fits in a given area. The Carbon Design System gives five row heights for tables (Carbon, Data table):
| Carbon size | Row height | Carbon’s use |
|---|---|---|
| xs | 24 px | The densest tables |
| sm | 32 px | Dense tables |
| md | 40 px | The default, “most commonly used” |
| lg | 48 px | More space per row |
| xl | 64 px | Only for rows with two lines |
Dense rows show more rows at once to compare, but they also make targets smaller and lines harder to follow across. Butterick calls more cell padding “the best way to improve the legibility of a dense table” (Butterick, Tables). Stashling’s rows are 36 px at 1280, between Carbon’s sm and md. The checkbox section of this module brings them to 40 px.
Zebra striping is a background color on every other row. The sources disagree on it. NN/g says stripes, borders and a hover color help people keep their place along a row. Ström calls stripes a bad idea, and Carbon offers them as an option. All three are expert opinion. The lab keeps its borders and adds no stripes, because the table is eight rows long.
Rule: Keep a data row on one line and let the table scroll, and choose row height for the task: denser to compare many rows, roomier to read and tap.
A table with nothing in it
A new Stashling account has no snapshots, so the table shows its headers and nothing else, followed by “Select a snapshot to restore its files”. An empty state is what a view shows when it has no data yet: the reason, what will happen, and what you can do.
NN/g gives three guidelines for empty states (Kaplan, NN/g, 2021). Say the system’s status: loading, no results and an error are different, and a table must never say “No records” while it’s still loading. Teach what the space is for. Give a direct way to fill it. These come from expert review with examples, not a study.
The lab adds one row at the end of the table body, with a message and one button:
<!-- excerpt from settings.html -->
<tr class="empty-row">
<td colspan="8">
<p>No snapshots yet. The first backup runs at 2:00 AM, as set under Backup schedule.</p>
<button class="button" type="button">Back up now</button>
</td>
</tr>
The server sends this row every time, after the real rows. CSS shows it only when it’s the only row:
/* excerpt from settings.css */
/* The empty state: a row that shows only when it is the table's only row */
.settings .empty-row:not(:only-child) {
display: none;
}
.settings .empty-row td {
padding: var(--space-5);
white-space: normal;
}
.settings .empty-row p {
margin-block-end: var(--space-inside);
}
:only-child has worked in every browser for many years. If the server knows the table is empty, it could send only this row and skip the CSS. But the rule keeps one template for both cases.

Figure 11: an empty table before and after. The after says why it is empty, when it will fill, and what you can do now.
The figure shows a leftover. The hint and the disabled Restore button still appear under an empty table. Hiding them needs the server or a script, and Module 9’s disabled-button debate applies to them.
A loading state is a different message. Carbon shows skeleton rows, gray bars in the shape of rows, for longer loads. Stashling’s page loads with its data, so the lab has no loading state.
Rule: An empty table says why it is empty and what happens next, and offers one action; a loading table says it is loading.
Checkboxes big enough to hit
The table’s checkboxes and the terms checkbox are Chrome’s default 13 × 13 px. Module 9 found that they pass WCAG 2.5.8 Target Size (Minimum) by its spacing exception, because 24 px circles around their centers do not overlap (Understanding 2.5.8). But passing by spacing still leaves a 13 px box to hit.
The lab sizes every checkbox at the 24 px floor, so it passes without the exception. A new token sits next to --target-min:
/* excerpt from tokens.css */
--target-small: 1.5rem; /* 24px: checkboxes, which have a label or a row to share the tap */
/* excerpt from base.css */
/* Checkboxes at WCAG 2.5.8's 24px floor, so they pass without its spacing exception */
input[type="checkbox"] {
inline-size: var(--target-small);
block-size: var(--target-small);
margin: 0;
}
The lab stops at 24 px, not the 44 px of the gear in Module 9. A 44 px checkbox would make every table row at least 52 px tall, beyond Carbon’s lg. The terms checkbox has a label that also toggles it, so the whole line takes the tap.
Chrome keeps drawing the checkbox itself at the new size. Its edge, sampled in the screenshots, is about #767676 in the light theme and #858585 in the dark one, the same colors as its default text fields. Those are 4.54:1 on white and 4.31:1 on #222222. accent-color could tint the checked box, but it isn’t Baseline in web-features 3.46.0, so the lab leaves the browser’s colors.
In the sign-up form, the label’s first line and the 24 px box now start at the same top edge:
/* excerpt from signup.css */
align-items: start; /* the box stays beside the first line of its label */
Pause and predict: the table’s rows were 36 px tall at 1280. What happens to them with 24 px checkboxes?

Figure 12: table checkboxes at 13 px and at 24 px.
Answer
They grow to 40 px at 1280, which is Carbon’s default md row height, and to 39.2 px at 390. They grow by 4 px, not by the 11 px the box gained, because the 27 px line of text already set most of the row’s height.
Rule: Size a checkbox at 24 px or more, and let its label take the tap as well.
Forms and tables: choices and costs
| Decision | Choice in the lab | Cost or limit | Choose something else when |
|---|---|---|---|
| Label position | Above, at every width | A taller form, more scrolling | A very long desktop form: labels beside fields (NN/g) |
| Rules | Hints under labels, linked with aria-describedby |
More text on the page | A field whose rule everyone knows, such as a name: no hint |
| Marking | “(optional)” on the one optional field | People may read unmarked as optional (Baymard’s 32%) | A checkout or long form: mark both (Baymard) |
| Field width | 20ch for the username, full width for the rest |
A rare long value scrolls inside the field | field-sizing: content once it is widely available |
| Field edge | --color-muted, 6.58:1 and 6.38:1 |
A darker edge on every field | A filled field style, with its own 3:1 check |
| Error timing | After the field, from :user-invalid |
Premature errors for slow typists (GOV.UK) | Long or high-stakes forms: submit only, with a summary |
| Error place | In the label, shown by :has() |
The browser’s bubble still appears; no aria-invalid |
A script with novalidate, an error summary and aria-invalid |
| Numbers | Right-aligned, tabular, found by :nth-child |
New columns mean new selector numbers | A class on each numeric cell (GOV.UK) |
| Units | One per column, in the header | Small values round to 0.0 | Values that span many sizes: a smaller unit, or exact values on a detail page |
| Phone rows | One line, the box scrolls | Three columns at a time | A frozen first column, or a card per row |
| Empty table | A row shown by :only-child |
The row is in every response | The server sends only the empty row |
| Checkboxes | 24 px | Rows grow from 36 to 40 px | A touch-first table: 44 px and a roomier row height |
What changed recently in CSS and standards
All Baseline statuses are from the web-features data, version 3.46.0, read on 2026-11-18.
:user-invalidand:user-validbecame Baseline widely available on 2026-05-02 (newly available on 2023-11-02). Before them, the common workaround was:not(:placeholder-shown):invalid, which needs a placeholder on every field.:has()became widely available on 2026-06-19.field-sizingis newly available since 2026-06-16.inputmodebecame widely available on 2024-06-07 andenterkeyhinton 2024-05-02. GOV.UK advisesinputmode="numeric"instead oftype="number", because scrolling over a number field changes its value.- The
patternattribute switched from theuflag to thevflag in mid-2023 (MDN), which is why an unescaped hyphen in a class now makes the whole pattern invalid. - WCAG 2.2, a W3C Recommendation since 5 October 2023, added 3.3.7 Redundant Entry (A) and 2.5.8 Target Size (Minimum) (AA).
- Not Baseline:
accent-color(supported since Safari 26.2, Chrome 93 and Firefox 92, but not Baseline in this data),autocapitalize, the customizable<select>, andtext-alignwith a character.
font-variant-numeric (widely available since 2022-07-15), the Constraint Validation API (since 2021-06-11), white-space and sticky positioning (since 2022-03-19) are widely available.
Online tools for this step
All three were checked on 2026-11-18.
- WAVE Web Accessibility Evaluation Tool, by WebAIM. You enter a public URL and get the page back with icons for errors and alerts, such as a field without a label, an empty button or low contrast. It runs without an account.
Limit: one page at a time, and the online version needs a public URL. For a local page such as the lab, WebAIM offers a free browser extension that checks the page inside the browser. WebAIM’s own words are “Only a human can determine true accessibility”. The tool finds a missing label but can’t judge whether a label or a message is clear. Chrome’s Lighthouse accessibility audit and the Accessibility pane in DevTools find missing labels and contrast problems too.
- Accessibility Insights for Web, by Microsoft. A Chrome and Edge extension with FastPass, automated checks for about 50 requirements plus a tab-stops view, and a guided Assessment of WCAG 2.1 AA with about 20 manual tests. It is open source under the MIT license.
Limit: Chromium browsers only, and the manual tests need your judgment. The automated checks find a missing label, not a vague one. The tab-stops view, which draws the order of focus on the page, has no direct equivalent in DevTools.
- Readability Test Tool, by WebFX. It scores a URL, pasted text or an uploaded file with several readability formulas, such as Flesch Reading Ease and Flesch-Kincaid Grade, plus sentence and word counts. It runs without an account.
Limit: it can’t read pages behind a login or pages built by JavaScript, so paste the text instead. The formulas count syllables and sentence length, so they say nothing useful about a three-word button or one error message; score a whole help page instead. DevTools has no equivalent. Hemingway Editor is a similar tool: its web editor runs without an account, and changing its target grade needs the paid Plus plan.
Check yourself
Critique: a team’s billing form
A team’s billing page has a form with five fields: Company name, Street address, City, Postal code and Email. Each field shows its label as a placeholder, #a9a9a9 on white, and has no visible label. The field edges are #dddddd, and every field is the full width of an 800 px form, including Postal code.
At the top, a note says “All fields are required”, but the code has no required on Company name. As you type in Email, a red message #ff6b6b appears below it after the first letter: “Invalid input”. The button says “Submit”.
Below the form, a table of invoices shows amounts centered: “$1,200”, “$85.5”, “$12.00”. The page’s font is set to proportional figures. While the invoices load, the table says “No records”.
Hint 1
Compute three ratios: the placeholder text, the field edges and the error text, each on white. Which WCAG criterion applies to each?
Hint 2
What happens to a placeholder when you type? What did Baymard find about a single “All fields are required” note?
Hint 3
When does the error appear, and what does it tell the person to do? Compare the timing with the table of three timings.
Hint 4
Read the amounts as a column. Where do the ones digits sit, and how many decimals does each value have? What should the table say while it loads?
Answer
- The placeholder text is 2.35:1 on white, below the 4.5:1 of WCAG 1.4.3, and it disappears when you type. So put a visible label above each field.
- The edges are 1.36:1 on white, below the 3:1 of WCAG 1.4.11, so an empty field barely shows. Use an edge of 3:1 or more.
- Postal code at full width suggests a long answer, so give it a width that fits a postal code, and keep the variable fields at one shared width.
- The note is wrong, because Company name is optional, and Baymard found such notes are overlooked. Mark Company name “(optional)”.
- The error appears while typing, after the first letter, which is a premature error. “Invalid input” names no fix. Show it after the person leaves the field or submits, and remove it as soon as the address is valid. Say “Enter an email address in the correct format, like name@example.com”.
#ff6b6bis 2.78:1 on white, so the text also needs a darker red. - “Submit” names no action. Use a verb and the object, such as “Save billing details”.
- The amounts are centered, with proportional figures and mixed precision. Right-align them, turn on tabular figures after checking the font, and give every amount two decimals: “$85.50”.
- “No records” while loading reports the wrong state. Show that the table is loading, and keep the empty message for a table with no invoices.
Review questions
- Why did Chrome 157 accept “Dana” in the
module-09username field? - When does
:user-invalidstart to match a text field, and when does it stop? - Why are the lab’s error messages inside the
<label>, and not linked witharia-describedby? - Why is
--color-borderthe wrong token for a field’s edge, and what does--color-field-borderuse? - What does right alignment fix in a numeric column, what do tabular figures fix, and why do you need both?
Answers
- Browsers compile
patternwith thevflag, under which an unescaped hyphen in a character class is a syntax error. The pattern was invalid, so it wasn’t applied. - It starts when the person commits a change and leaves the field, or tries to submit. Once it matches, it stops on the keystroke that makes the value valid.
- Text inside a label joins the field’s accessible name only while it’s shown. But a description that points at hidden text is still read, so the error would be announced before anything was wrong.
--color-borderis#bebebe, 1.86:1 on white and 2.42:1 in the dark theme, below the 3:1 of WCAG 1.4.11.--color-field-borderuses--color-muted: 6.58:1 and 6.38:1.- Right alignment puts the ones digits on one edge, so length shows size. Tabular figures give every digit the same width, so each place value sits in one vertical line. But with proportional figures, right-aligned digits still drift, as the middle panel of Figure 7 shows.
The lab: a form that explains itself and a table that lines up
In about 15 minutes, you move the labels, write the rules and the errors, and restyle the fields. Then you line up the table’s numbers, give it one unit per column and an empty state, and enlarge the checkboxes. Start from the module-09 folder and reload after each step. The finished files are in the module-10 folder of the course repository.
Step 1: put every label above its field
Why: side labels break the form into two columns on wide screens (see “Labels above their fields”).
In signup.css:
- Delete the
container-typeline from.signup-form. - Replace the comment and the
.signup-form .rowrule with these lines:
/* Each label above its field, and more space between fields than inside one */
.signup-form .row {
display: grid;
gap: var(--space-1);
margin-bottom: var(--space-inside);
}
- Delete the
.signup-form .actionsrule, the@container (width >= 22rem)block and the comment above it.
What you should see: Figure 3 instead of Figure 1 at 1280, after you press “Create account” with every field empty.
Step 2: write the rules and mark the optional field
Why: the username and password rules are written nowhere, and the username rule doesn’t run (see “Say the rule before anyone breaks it”).
In signup.html, replace the Full name, Email, Username and Password rows with these four rows:
<div class="row">
<label for="name">Full name (optional)</label>
<input type="text" id="name" name="name" autocomplete="name">
</div>
<div class="row">
<label for="email">Email</label>
<input type="email" id="email" name="email" autocomplete="email" required>
</div>
<div class="row">
<label for="username">Username</label>
<p class="hint" id="username-hint">Use 3 to 20 lowercase letters, numbers or hyphens</p>
<input type="text" id="username" name="username" pattern="[a-z0-9\-]{3,20}" autocomplete="username" autocapitalize="none" spellcheck="false" aria-describedby="username-hint" required>
</div>
<div class="row">
<label for="password">Password</label>
<p class="hint" id="password-hint">Use at least 12 characters</p>
<input type="password" id="password" name="password" minlength="12" autocomplete="new-password" aria-describedby="password-hint" required>
</div>
At the end of signup.css, add this rule:
/* A hint states a field's rule before anyone breaks it */
.signup-form .hint {
margin: 0;
color: var(--color-muted);
}
What you should see: Figure 4 after a submit attempt. Type “Dana” as the username and fill in the other fields: the form now refuses it.
Step 3: give fields a visible edge and a width that fits
Why: the card border token would fail 3:1 on a field, and every field is as wide as the form (see “Fields that look like fields and fit their answers”).
In tokens.css, add this line after --color-focus:
--color-field-border: var(--color-muted); /* the edge of a field: 3:1 or more on surface (WCAG 1.4.11) */
In base.css, add this rule after the button, input, select, textarea rule:
/* Fields: an edge with 3:1 against the page, the theme's colors, the buttons' corners */
input:not([type="checkbox"]),
select {
padding: var(--space-2);
border: 1px solid var(--color-field-border);
border-radius: var(--radius-small);
background: var(--color-surface);
color: inherit;
font-size: var(--step-0);
}
In signup.css, replace the rule for input[type="text"], input[type="email"], input[type="password"] and select with this one:
/* A username has at most 20 characters, so its field is 20 characters wide */
.signup-form [name="username"] {
max-inline-size: 20ch;
}
In settings.css, delete font-size: var(--step-0); from the .settings input, .settings select rule, because base.css now sets it.
What you should see: Figure 5 after a submit attempt. On settings.html, every field has the same edge and corners, in both themes.
Step 4: show each error next to its field
Why: a submit attempt shows one bubble on one field, and nothing in the page’s text (see “When an error should appear” and “:user-invalid: the browser’s own timing”).
In signup.html, replace four labels:
<label for="email">Email <span class="field-error">Enter an email address in the correct format, like name@example.com</span></label>
<label for="username">Username <span class="field-error">Enter a username of 3 to 20 lowercase letters, numbers or hyphens</span></label>
<label for="password">Password <span class="field-error">Enter a password of at least 12 characters</span></label>
<label for="terms">I agree to the <a href="#">terms of service</a> <span class="field-error">Agree to the terms of service to create an account</span></label>
At the end of signup.css, add these rules:
/* Errors. Each message waits inside its field's label and shows once the browser
flags the field: after someone changes it and leaves, or tries to submit */
.signup-form .field-error {
display: none;
font-weight: 600;
color: var(--color-danger);
}
.signup-form .row:has(:user-invalid) .field-error {
display: block;
}
/* The message repeats the rule, so the hint steps aside */
.signup-form .row:has(:user-invalid) .hint {
display: none;
}
.signup-form :user-invalid {
border-color: var(--color-danger);
}
What you should see: Figure 6 after a submit attempt. Reload, type “dana” in Email and press Tab: the Email message appears. Go back and finish the address: it disappears on the last keystroke.
Step 5: line up the numbers
Why: numbers are left-aligned in proportional figures, and headers are centered (see “Numbers that line up”).
In settings.css, replace the .settings th, .settings td rule with these two rules:
.settings th,
.settings td {
border: 1px solid var(--color-border);
padding: var(--space-1) var(--space-2);
text-align: start; /* headers too: browsers center them */
}
/* Columns 4 to 7 hold numbers: right-aligned, every digit the same width,
so ones sit under ones. Change the numbers if the columns change. */
.settings :is(th, td):nth-child(n + 4):nth-child(-n + 7) {
text-align: end;
font-variant-numeric: tabular-nums;
}
What you should see: Figure 8 instead of Figure 2.
Step 6: one unit and one precision per column
Why: mixed units hide which values are large (see “One unit and one precision per column”).
In settings.html, change the headers <th>Size</th> and <th>Added</th> to these:
<th>Size (GB)</th>
<th>Added (MB)</th>
Then change the Size, Added and Duration cells of each row to these values:
| Snapshot | Size (GB) | Added (MB) | Duration |
|---|---|---|---|
| c41e8a2 | 1.42 | 0.0 | 0:01:09 |
| a3f9c21 | 1.42 | 3.1 | 0:04:12 |
| 9be04d7 | 1.42 | 0.8 | 0:00:41 |
| 51c8e0a | 1.41 | 210.6 | 0:18:03 |
| 7c2a19f | 0.00 | 0.0 | 0:00:02 |
| 3d81f6e | 0.99 | 1,200.0 | 1:04:00 |
| f5a0b92 | 0.08 | 0.4 | 0:00:09 |
| 0e6d7c3 | 0.08 | 76.1 | 0:02:07 |
What you should see: Figure 9.
Step 7: keep each row on one line
Why: on a phone, dates wrap over four lines and rows are 106 px tall (see “Rows on a phone, and how dense a table should be”).
In settings.css, add this line at the end of the .settings th, .settings td rule, after text-align: start;:
white-space: nowrap; /* one line per row; the box scrolls sideways instead */
What you should see: at 390 px, the right half of Figure 10. At 1280 the table looks the same as before.
Step 8: give the table an empty state
Why: a table with no snapshots shows headers and nothing else (see “A table with nothing in it”).
In settings.html, add the empty-row row from that section after the last </tr> and before </tbody>. In settings.css, add the three .empty-row rules from that section before the .status rule and its comment.
What you should see: no change, because the table has rows. In the Console, run document.querySelectorAll("tbody tr:not(.empty-row)").forEach((r) => r.remove()) to see the bottom half of Figure 11.
Step 9: make checkboxes 24 px
Why: 13 px checkboxes pass WCAG 2.5.8 only by its spacing exception (see “Checkboxes big enough to hit”).
In tokens.css, add this line after --target-min:
--target-small: 1.5rem; /* 24px: checkboxes, which have a label or a row to share the tap */
In base.css, add this rule after the field rule from Step 3:
/* Checkboxes at WCAG 2.5.8's 24px floor, so they pass without its spacing exception */
input[type="checkbox"] {
inline-size: var(--target-small);
block-size: var(--target-small);
margin: 0;
}
In signup.css, in the .signup-form .checkbox-row rule, replace align-items: baseline; with this line:
align-items: start; /* the box stays beside the first line of its label */
What you should see: Figure 12 on settings.html; rows are 40 px tall at 1280. The terms checkbox is 24 px and lines up with the top of its label.
Step 10: check both themes and both widths
Why: every color in this module was computed for two themes, and every width was chosen for two screens.
Look at signup.html and settings.html at 390 and 1280 px, in the light and the dark theme. On signup.html at 390 in the dark theme, type a valid email, type “Dana” as the username, and click an empty part of the page.
What you should see: at 320 px, document.documentElement.scrollWidth is still 320 on all four pages. The sign-up form looks like Figure 13: one message, under Username, with a light red edge, and the Password hint still in place, because you haven’t left that field.

Figure 13: after the lab, in the dark theme at 390 px. One error, shown after the person left the field, in words.
Optional: apply it to a form and a table of your own
Pick a form and a data table from your own work.
- Find every rule a field enforces (
pattern,minlength, server checks) and check that the page states it next to the label. Paste eachpatternintonew RegExp(pattern, "v")to see whether it compiles. - Compute each field’s edge against its page in every theme, and replace any edge under 3:1.
- Decide your error timing from the table of three timings, write the reason in a comment, and rewrite every message so that it starts with what to do.
- In each table, right-align the numeric columns and their headers, check your font for
tnumwith the Console test, and give each column one unit and one precision. - Empty every table and every list in your product, and read what each one says.
Module 10 cheat sheet
Labels above the field; 4px to its field, 16px to the field above
Hints the field's rule under its label; never only a placeholder
Optional mark the few: "(optional)"; keep `required` on the rest
Width sized to the answer: 20ch for 20 characters; full for email
Edges 3:1 on the page: --color-field-border, not --color-border
Errors after the field or submit; in words, in the label; :user-invalid
Words errors start with the fix ("Enter…"); buttons: verb + object
Numbers right-aligned, tabular-nums (check tnum), one unit per column
Empty why it is empty, what happens next, one action; never while loading
Module 11, Usability: Conventions, Navigation and Quick Tests, starts with visitors who cannot find the settings page.
Sources
Standards and W3C guidance:
- W3C, Understanding WCAG 2.2: 1.3.5 Identify Input Purpose, 1.4.11 Non-text Contrast, 2.5.8 Target Size (Minimum), 3.1.5 Reading Level, 3.3.1 Error Identification, 3.3.3 Error Suggestion and 3.3.7 Redundant Entry. The place to start for going deeper on form errors.
- WHATWG, HTML Living Standard: form control infrastructure, on user validity and constraint validation, and the input element.
CSS and HTML references:
- MDN, :user-invalid, pattern, autocomplete, font-variant-numeric and field-sizing.
- web.dev, Sign-up form best practices.
Design systems and guidance, cited for what they recommend:
- GOV.UK Design System: Text input, Error message, Error summary, Button, Table, and the Validation and Question pages patterns.
- US Web Design System, Table; Carbon Design System, Data table.
- NN/g: Kathryn Whitenton, “Website Forms Usability: Top 10 Recommendations“, 2016; Katie Sherwin, an article on placeholders in form fields, 2014; Raluca Budiu, “Marking Required Fields in Forms“, 2019; Neusesser and Sunwall, “Error-Message Guidelines“, 2023; Anna Kaley, “UI Copy: UX Guidelines for Command Names and Keyboard Shortcuts“, 2019; Page Laubheimer, “Data Tables: Four Major User Tasks“, 2022; Kate Kaplan, “Designing Empty States in Complex Applications: 3 Guidelines“, 2021.
- Jakob Nielsen, “Required Fields in Forms“, 2025.
- Matthew Butterick, Practical Typography: Alternate figures and Tables.
- Matt Ström, “Design better data tables“, first published in 2017.
Research, cited with the strength of its evidence:
- Mirjam Seckler, Silvia Heinz, Javier A. Bargas-Avila, Klaus Opwis and Alexandre N. Tuch, “Designing Usable Web Forms: Empirical Evaluation of Web Form Improvement Guidelines“, CHI 2014: 65 participants, 20 guidelines tested together. Google’s summary: “Simple is better“, 2014.
- Luke Wroblewski, “Inline Validation in Web Forms“, A List Apart, 2009: 22 participants, six versions of one form.
- Matteo Penzo, “Label Placement in Forms“, UXmatters, 2006: an informal eye-tracking test, number of participants not stated.
- Das, McEwan and Douglas, “Using eye-tracking to evaluate label alignment in online forms“, NordiCHI 2008: a small study; we read the abstract only.
- Baymard Institute: “Field Label UX: Place Labels Above the Field“, 2013; “Form Field Usability: Matching User Expectations“, 2010; “E-Commerce Checkouts Need to Mark Both Required Fields and Optional Fields Explicitly“, 2018; “Usability Testing of Inline Form Validation: 31% Don’t Have It, 4% Get It Wrong“, 2024. Large commercial usability testing, with methods only partly published.
Browsers:
- The web-features data, version 3.46.0, for every Baseline status in this module.
The contrast ratios come from color-calc/m10/m10.mjs, the digit widths from color-calc/m10/tnum.py, and the :user-invalid timing and accessible names from color-calc/m10/timing.mjs and ax.mjs. The measured sizes come from runs of the lab pages in headless Chrome 157 on macOS, with a 16 px default font size. Your numbers will differ with other browsers and settings.