Card table with sorting and filters in WordPress
A timetable table sorted by column and filtered with level and free-place chips, whose rows each become a card on phones.
Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.
This component also comes in
The code in WordPress
<!-- wp:html -->
<section class="tcf" data-tcf aria-labelledby="tcf-titre">
<div class="tcf-intro">
<h2 class="tcf-title" id="tcf-titre">Planning des cours</h2>
<p class="tcf-lead">Choisissez un niveau, puis triez par jour, horaire ou places libres. Tapis et coussins fournis.</p>
</div>
<div class="tcf-tools" data-tcf-tools hidden>
<div class="tcf-group" role="group" aria-labelledby="tcf-niveau">
<span class="tcf-glabel" id="tcf-niveau">Niveau</span>
<div class="tcf-chips">
<button class="tcf-chip" type="button" aria-pressed="true" data-tcf-level="">Tout afficher</button>
<button class="tcf-chip" type="button" aria-pressed="false" data-tcf-level="Tous niveaux">Tous niveaux</button>(() => {
if (!document.querySelector(".tcf")) return;
document.querySelectorAll("[data-tcf]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const tbody = root.querySelector("tbody");
const rows = [...tbody.rows];
const heads = [...root.querySelectorAll("th[data-tcf-key]")];
const select = root.querySelector("[data-tcf-select]");
const status = root.querySelector("[data-tcf-status]");
const empty = root.querySelector("[data-tcf-empty]");
const levels = [...root.querySelectorAll("button[data-tcf-level]")];
const free = root.querySelector("[data-tcf-free]");:root {
--tcf-card: #ffffff;
--tcf-text: #1c2422;
--tcf-muted: #4a5754;
--tcf-line: #d9e2df;
--tcf-head: #f1f6f4;
--tcf-accent: #0f766e;
--tcf-on-accent: #ffffff;
--tcf-level: #eef3f1;
--tcf-free: #dcf3ec;
--tcf-free-text: #0b5c4f;
--tcf-full: #fde8e8;<?php
/**
* Plugin Name: Forge, Tableau en cartes avec tri et filtres
* Description: Un planning en tableau que l’on trie par colonne et filtre par puces de niveau et de places libres, dont chaque ligne devient une carte sur téléphone. Ajoute la composition « Tableau en cartes avec tri et filtres » à l'éditeur de blocs.
* Version: 1.0.0
* Requires at least: 6.6
* Requires PHP: 8.1
* Author: Forge
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: forge-tableau-cartes-mobile-tri-filtres
*Free component: copy it freely, including for commercial projects.
Other data tables components in WordPress
Data tables components in WordPress
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 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

The results of a race or competition, sortable by place, name or category, with the podium highlighted, the gap to the winner and the sort order announced.
- Tailwind
- React
- CSS
- WordPress