Team rota with a person filter in WordPress
A weekly on-call or duty rota, days as rows and time slots as columns, with a filter by person and the number of slots announced.
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="tpe" data-tpe aria-labelledby="tpe-titre">
<p class="tpe-eyebrow">Cabinet infirmier des Tilleuls · Poitiers</p>
<h2 class="tpe-title" id="tpe-titre">Planning des tournées, semaine 45</h2>
<div class="tpe-field">
<label class="tpe-label" for="tpe-personne">Afficher les tournées de</label>
<select class="tpe-select" id="tpe-personne" data-tpe-filter>
<option value="">Toute l’équipe</option>
<option value="claire">Claire</option>
<option value="malik">Malik</option>
<option value="sophie">Sophie</option>
<option value="yann">Yann</option>(() => {
if (!document.querySelector(".tpe")) return;
document.querySelectorAll("[data-tpe]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const filter = root.querySelector("[data-tpe-filter]");
const count = root.querySelector("[data-tpe-count]");
const slots = [...root.querySelectorAll("[data-tpe-slot]")];
const total = root.querySelectorAll("[data-tpe-person]").length;
on(filter, "change", () => {
const who = filter.value;
let shown = 0;:root {
--tpe-card: #ffffff;
--tpe-text: #1b2230;
--tpe-muted: #4f5a6d;
--tpe-line: #dfe4ec;
--tpe-accent: #0e7490;
--demo-tableau-planning-equipe-bg: #e7eef1;
--demo-tableau-planning-equipe-text: #1b2230;
--tpe-claire-bg: #dbeafe;
--tpe-claire: #1e3a8a;
--tpe-malik-bg: #dcfce7;
--tpe-malik: #14532d;<?php
/**
* Plugin Name: Forge, Planning d’équipe filtrable
* Description: Un planning de gardes ou de permanences sur la semaine, jours en lignes et créneaux en colonnes, avec un filtre par personne et le nombre de créneaux annoncé. Ajoute la composition « Planning d’équipe filtrable » à 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-planning-equipe
*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 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