Skip to content

Pricing Comparison Table

Dark Bootstrap 5 plan comparison table with grouped features, highlighted popular plan, sticky feature column, tooltips and a show-only-differences switch.

Also known as: plan comparison table, feature comparison table, pricing plans comparison, compare plans page

Pricing Comparison Table live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A dark Bootstrap 5 pricing comparison table that lines up four plans against grouped feature rows, highlights the most popular plan and can hide every feature that is the same in all plans. Use it under your pricing cards or on a dedicated "Compare plans" page for SaaS products.

How it works

The root is section.pq-compare with data-bs-theme="dark", so Bootstrap's own components (the switch and tooltips) render in dark mode. The table sits in a .table-responsive.pq-scroll wrapper: on narrow screens it scrolls sideways while the feature column (th[scope="row"] and .pq-corner) stays pinned with position: sticky. The thead holds one th.pq-plan per plan with name, price and a button. Each tbody.pq-group starts with a .pq-group__head row (scope="colgroup") followed by feature rows. Included features show a .pq-yes check icon, missing ones a .pq-no dash, and both carry visually hidden "Included" / "Not included" text.

On DOMContentLoaded the script reads data-pq-highlight on .pq-table and adds .pq-col--pop to every cell in that column, which draws the tinted, outlined popular column. It then compares the text of all td cells in each row and marks identical rows with .pq-row--same (and whole groups with .pq-group--same). When the .pq-diff switch fires change, the root gets .pq-compare--diff, the CSS hides those rows, and .pq-count reports how many features are visible. Buttons with data-bs-toggle="tooltip" are initialized as Bootstrap tooltips.

Customization

  • --pq-accent, --pq-accent-ink and --pq-accent-rgb in .pq-compare: change the check icons, group headings, badge, primary button and popular column tint.
  • --pq-bg and --pq-surface in .pq-compare: set the page background and the table card color.
  • data-pq-highlight="3" on .pq-table: highlight another plan column (1 is the first plan), or remove the attribute for no highlight.
  • --pq-feature-width in .pq-compare: widen the sticky feature column for longer feature names.
  • min-width: 48rem in .pq-table: the width at which the table starts to scroll horizontally.
  • Add a column: append a col, a th.pq-plan and one td per row, then update colspan="5" on the group heads.
  • Move .pq-plan__badge into another th.pq-plan to promote a different plan.

Use cases

  • SaaS pricing pages: four plans line up against grouped feature rows under the pricing cards
  • Compare plans pages: the most popular plan is highlighted so visitors see the recommended choice
  • Long feature lists: a sticky feature column keeps labels visible when the table scrolls sideways
  • Decision support: a show-only-differences switch hides features that are the same in every plan

Accessibility

The table has a visually hidden caption, column headers use scope="col", feature names scope="row" and group titles scope="colgroup", so screen readers announce each cell with its plan and feature. Icons are aria-hidden and replaced by hidden text. The scroll wrapper is a focusable role="region" labelled by the caption, so keyboard users can scroll it with arrow keys. The switch uses role="switch", and .pq-count is a polite live region. Info buttons are real button elements with an aria-label, so tooltips open on focus as well as hover. Focus rings use the accent color.

Usage notes

Requires Bootstrap 5.3 (for data-bs-theme) with its JS bundle, and Bootstrap Icons. Several tables can share a page; each .pq-compare is handled on its own, but give each a unique switch id.

Pricing Comparison Table at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Pricing Tables
License
Free for personal and commercial use

Questions about this template

Can I use the Pricing Comparison Table code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Pricing Comparison Table – free Bootstrap 5 pricing table template
Pricing Comparison Table · free Bootstrap 5 pricing table template

More Pricing Tables

Pricing Cards with Billing Toggle – free Bootstrap 5 pricing table template

Pricing Cards with Billing Toggle

Bootstrap 5 pricing cards with a Monthly / Annual segmented switch that updates prices, savings and yearly totals, plus a highlighted featured plan.

Pricing Table with Feature Tooltips – free Bootstrap 5 pricing table template

Pricing Table with Feature Tooltips

Bootstrap 5 plan comparison table with a highlighted popular plan and info tooltips that explain every feature on hover or keyboard focus.

Pricing with Team Size Range – free Bootstrap 6 pricing table template

Pricing with Team Size Range

Bootstrap 6 per-seat pricing card with a Range slider for team size, volume tiers, a monthly/annual toggle and a live total price.

Dark Pricing Section – free Bootstrap 6 pricing table template

Dark Pricing Section

Dark Bootstrap 6 pricing section with three glass cards, a gradient-bordered recommended plan, a currency Menu and an FAQ link that opens a Drawer with an accordion.

Pricing Comparison Table – free Bootstrap 6 pricing table template

Pricing Comparison Table

Bootstrap 6 feature comparison table across four plans with check icons, a highlighted Pro column, tooltips, a sticky feature column and an Only differences filter.

Pricing Table with Highlighted Plan – free Bootstrap 6 pricing table template

Pricing Table with Highlighted Plan

Bootstrap 6 pricing cards with a raised dark green Most popular plan, gold accents and a team-size Range slider that recalculates every plan's monthly total.