Mobile-Friendly Product Spec Tables That Work

Zusammenfassung

Pixel shares practical guidance for building accessible, mobile-friendly specification tables on hardware and electronics product pages. The announcement covers semantic table markup, row headers and captions, plus layouts for comparing product variants across sizes.

DEV Community

Spec tables on product pages: keep them as real tables, and make them work on a phone

Every hardware or electronics product page ends up with a spec table. Thread size, length, material, voltage range, what's in the box. It's the part of the page people scroll straight to when they already know what they want. It's also the part that gets built as a pile of

s, or a two-column grid that falls apart below 400px. A few notes on doing it in a way that holds up. Use a table. It is tabular data. Key/value specs are exactly what is for. You get row and header relationships for free, and screen readers can announce "Material, stainless steel" instead of two unrelated words.
Specifications

Material Stainless steel A2 Thread M8 Length 60 mm


The two details people skip: scope="row" on the label cell, and a . The caption can be visually hidden if the section already has a heading, but having it means the table has a name when someone jumps between tables. A description list ( ) is also a fair choice for a short, simple list of specs. Once you have more than a handful of rows, or anything that compares variants, go with the table. Comparing variants is where it gets harder When one product comes in several sizes, the spec table often turns into a grid: sizes across the top, properties down the side.
Sizes

6 mm 8 mm 10 mm

Drill bit 6 mm8 mm10 mm Screw size 4–5 mm5–6 mm6–8 mm


(The values here are just example data to show the shape.) With both scope="col" and scope="row", a screen reader can announce the cell with both headers. Without them, someone tabbing through hears a list of numbers with no context. Making it fit on a phone There are two honest options. Pick based on the table's shape. Two-column key/value tables: let them wrap. Most of the time the only CSS you need is to stop the label column from being squeezed: .specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { padding: .5rem .75rem; text-align: start; vertical-align: top; }
.specs th { width: 40%; font-weight: 600; }
.specs tr + tr > * { border-top: 1px solid #e5e7eb; }
Note text-align: start instead of left. If the site also runs in a right-to-left language, it flips on its own. Wide comparison tables: let them scroll horizontally inside a container, and don't fight it.



Sizes ...


.table-scroll { overflow-x: auto; }
.specs--compare th[scope="row"] {
position: sticky;
inset-inline-start: 0;
background: #fff;
}
The tabindex="0" and role="region" with a label let keyboard users focus the scroll area and move it with the arrow keys. The sticky first column keeps the row labels visible while the values scroll. What I'd avoid is the "turn every row into a card with display: block" trick. It looks neat, but changing a table's display can strip its table semantics in some browser and screen reader combinations, and then you've lost the thing that made it a table in the first place. If you go that route, test it with an actual screen reader. Small things that make specs easier to read Units in the value, consistently. "60 mm" in every row, not "60" in one row and "6 cm" in the next. If you show two unit systems, pick one as primary and keep the other in a smaller span. Non-breaking space between number and u...
Mobile-Friendly Product Spec Tables That Work
Powered by Readybot.io

Das Neueste von Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …