SaaS pricing table template: HTML and CSS, done right
What a SaaS pricing table template needs in its HTML and CSS: plan cards, an honest monthly or yearly switch without JavaScript, dark mode and a comparison table.
You searched for a SaaS pricing table template, and most of what you found is a screenshot, a page builder block or a component that pulls in a framework. You want something you can paste into your own site, that works on a phone, in dark mode and with a keyboard, and that does not slow the page down. That comes down to a few decisions in the HTML and CSS.
This guide walks through those decisions, part by part. For what the page should say, see how to design a SaaS pricing page; for real pages to learn from, see SaaS pricing page examples.
A pricing table in plain terms
Think of it like a restaurant menu. Each dish has a name, a price and a short line about what is in it. The menu is easy to read at the table, in dim light, and the waiter does not need to explain it. A pricing table should work the same way on any screen.
The template has four parts: the plan cards, the billing switch, the comparison table and the styles that make all of it readable in light and dark mode.
Plan cards: a list, not a table
Each plan is a separate choice, so mark the plans up as a list: a ul with one li per plan. Inside each card:
- A heading with the plan name, such as an
h3, so screen reader users can jump from plan to plan. - A price with its unit and period, for example “$12 per seat / month”. A bare “$12” leaves the buyer guessing.
- A feature list, another
ul, with the differences first. - A button that names the plan, such as “Start Team trial”. Three buttons that all say “Get started” sound the same to a screen reader.
Highlight one plan at most, the one you want most buyers on, and say why in words (“Most teams pick this”) as well as with color.
A monthly or yearly switch without JavaScript
The switch is two radio inputs inside a fieldset, styled to look like a toggle. CSS reads which one is checked with the :has() selector and shows the matching price. MDN lists :has() as Baseline widely available, so it works in current browsers without a script.
Two details matter:
- Both prices share one grid cell. Stack the monthly and yearly price in the same cell and hide one with
visibility: hidden. The box keeps its size, so switching does not move anything on the page. - The saving is computed, not rounded up. If yearly is $15 a month and monthly is $18, the saving is 1 - 15/18 = 16.7%. Write “Save 16%”, never “Save 20%”, and state the yearly charge: $15 x 12 = $180 a year.
The comparison table: a real table
Below the cards, a feature-by-plan comparison is tabular data, so it belongs in a table. The W3C accessibility tutorial on tables says header cells must be marked up with th and data cells with td, and recommends scope="col" or scope="row" to say which way each header applies. Give the table a caption, such as “Compare plans”, so it has a name.
For a check mark, add hidden text such as “Included”, so a screen reader does not read an empty cell. On a phone, let the table scroll inside its own container instead of shrinking the text.
Dark mode and contrast
The prefers-color-scheme media feature tells you whether the visitor asked for a light or dark theme in their system settings. Define your colors as CSS custom properties, then give them dark values inside that media query, so the template follows the visitor’s choice.
Check contrast in both themes. WCAG 2.2 asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Brand colors fail most often on the highlighted card and the button text.
Checklist before you ship
| Part | What to check | How to check it |
|---|---|---|
| Plan cards | One heading per plan, a price with unit and period | Read the page with a screen reader’s heading list |
| Buttons | Each label names the plan and the action | Read the buttons out of context |
| Highlight | At most one plan, explained in words | Look at the page in grayscale |
| Billing switch | Works with the keyboard; nothing moves when switching | Tab to it, press the arrow keys, watch the layout |
| Saving | Percentage computed from your prices and rounded down | Redo the math: 1 - yearly / (monthly x 12) |
| Comparison table | caption, th with scope, text for check marks |
Inspect the HTML |
| Dark mode | Every color has a dark value; text keeps 4.5:1 | Switch your system theme, run a contrast checker |
| Small screens | No horizontal scroll at 390 px wide | Resize the browser window |
Starting from a template
You can build all of this by hand in an afternoon or two. If you would rather start from tested code, SaaSCron sells the Pricing Page Kit for US$49, one time. It has 12 layouts, each a single HTML file with one style block: no JavaScript, no frameworks, no web fonts and no network requests. They include a classic three-tier table, the CSS-only monthly and yearly switch described above, per-seat, usage-based, freemium with enterprise and a full comparison matrix. Six CSS variables at the top of each file set your brand color, accent, corner radius, font and width, and dark mode is built in.
The kit also has a teardown guide on when to use each layout, and an agent skill for Claude Code and Cursor that picks a layout from your answers. All names and prices in the layouts are fictional placeholders.
Disclosure: SaaSCron makes and sells the Pricing Page Kit. The checklist above applies to any template.
Common mistakes
- Building the plans as a table. Why it happens: it is called a “pricing table”. Instead: use a list of cards for plans and a real table only for the comparison.
- A toggle that shifts the layout. Why it happens: the two prices have different widths. Instead: stack both in one grid cell and hide one with
visibility. - A rounded-up saving. Why it happens: “Save 20%” looks better than “Save 16%”. Instead: compute it from your prices and round down.
- Dark mode as an afterthought. Why it happens: the template is designed in light mode. Instead: set every color as a variable with a dark value from the start.
Sources
- W3C Web Accessibility Initiative, Tables tutorial, checked November 10, 2026.
- W3C, Understanding WCAG 2.2: Contrast (Minimum), checked November 10, 2026.
- MDN Web Docs, :has(), checked November 10, 2026.
- MDN Web Docs, prefers-color-scheme, checked November 10, 2026.
- Pricing Page Kit layouts, teardown guide and pricing, from its product page and files, checked November 10, 2026.
In three sentences
A SaaS pricing table template should mark up plans as a list of cards, each with a heading, a price with its unit and period, and a button that names the plan. A monthly or yearly switch can run on two radio inputs and the CSS :has() selector, with both prices in one grid cell and a saving computed from your own prices and rounded down. Put the feature comparison in a real table with a caption and scoped headers, and give every color a dark-mode value that keeps text at 4.5:1 contrast.
Frequently asked questions
What should a SaaS pricing table template include?
Plan cards with a name, a price with its unit and billing period, a short feature list and a button that names the plan. Add a monthly or yearly switch if you sell both, a comparison table with real table headers, an FAQ, and styles for dark mode and small screens.
Can a monthly or annual pricing toggle work without JavaScript?
Yes. Two radio inputs and the CSS :has() selector can show one price and hide the other. MDN lists :has() as Baseline widely available. Put both prices in the same grid cell so switching does not move the layout.
Should a pricing table be an HTML table?
Use a table for the feature comparison, because it is tabular data, with a caption and th cells marked with scope. Use a list of cards for the plans themselves, since each plan is a separate item, not a row of data.
How do I show the annual discount honestly?
Compute it from your own prices and round down. If annual is $15 a month against $18 monthly, the saving is 1 - 15/18 = 16.7%, so say "Save 16%" and state the yearly charge, $180, next to it.