Table with search and filters in HTML and CSS
A directory table filtered by free search and by category, with the result count announced and rows turned into cards on phones.
Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.
This component also comes in
The code in HTML and CSS
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tableau avec recherche et filtres</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="demo">
<section class="trf" data-trf aria-labelledby="trf-titre">
<h2 class="trf-title" id="trf-titre">Annuaire des associations</h2>document.querySelectorAll("[data-trf]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const q = root.querySelector("#trf-q");
const cat = root.querySelector("#trf-cat");
const rows = [...root.querySelectorAll("[data-trf-row]")];
const fold = (s) =>
s
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.toLowerCase();
root.querySelector("[data-trf-filters]").hidden = false;
:root {
--trf-card: #ffffff;
--trf-text: #1a2131;
--trf-muted: #4b5563;
--trf-line: #dde2ea;
--trf-field: #ffffff;
--trf-head: #f3f5f9;
--trf-chip: #eef2ff;
--trf-chip-text: #3730a3;
--trf-accent: #4338ca;
--demo-bg: #eceff4;
--demo-text: #1a2131;Free component: copy it freely, including for commercial projects.
Other data tables components in HTML and CSS
Data tables components in HTML and CSS
A documentation table showing where a kit or component has been tested (static HTML, WordPress, Elementor, Webflow, v0…), with status, last test date and a remark, filterable by status.
- Tailwind
- React
- CSS
- WordPress

A table of the towns and postcodes a tradesperson covers, with response time and travel fee, filtered by search and by zone.
- Tailwind
- React
- CSS
- WordPress

A timetable table sorted by column and filtered with level and free-place chips, whose rows each become a card on phones.
- Tailwind
- React
- CSS
- WordPress

A filterable table whose visible rows export in one click to a CSV file that opens cleanly in Excel or LibreOffice.
- Tailwind
- React
- CSS
- WordPress

A price table by service: one package to pick, options to tick, and the total with the estimated time recalculated on every click.
- Tailwind
- React
- CSS
- WordPress

A product spec sheet as two-column tables in native collapsible sections, with a button to open or close them all.
- Tailwind
- React
- CSS
- WordPress