Spec sheet with collapsible sections in WordPress
A product spec sheet as two-column tables in native collapsible sections, with a button to open or close them all.
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="tsp" data-tsp aria-labelledby="tsp-titre">
<div class="tsp-top">
<div>
<p class="tsp-eyebrow">Vélo électrique urbain Vercors E7</p>
<h2 class="tsp-title" id="tsp-titre">Fiche technique</h2>
</div>
<button class="tsp-toggle" type="button" data-tsp-toggle hidden>Tout ouvrir</button>
</div>
<details class="tsp-section" data-tsp-section open>
<summary class="tsp-summary">Moteur et batterie<span class="tsp-count">5 caractéristiques</span></summary>
<table class="tsp-table">(() => {
if (!document.querySelector(".tsp")) return;
document.querySelectorAll("[data-tsp]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const toggle = root.querySelector("[data-tsp-toggle]");
const sections = [...root.querySelectorAll("[data-tsp-section]")];
const sync = () => {
const allOpen = sections.every((section) => section.open);
toggle.textContent = allOpen ? "Tout replier" : "Tout ouvrir";
toggle.setAttribute("aria-expanded", String(allOpen));
};:root {
--tsp-card: #ffffff;
--tsp-text: #1a2118;
--tsp-muted: #4e5a4b;
--tsp-line: #dce3d8;
--tsp-soft: #f2f6ef;
--tsp-accent: #3f6212;
--demo-tableau-specifications-produit-bg: #e9eee5;
--demo-tableau-specifications-produit-text: #1a2118;
}
@media (prefers-color-scheme: dark) {<?php
/**
* Plugin Name: Forge, Fiche technique à sections repliables
* Description: Une fiche technique produit en tableaux à deux colonnes, rangés dans des sections repliables natives, avec un bouton pour tout ouvrir ou tout replier. Ajoute la composition « Fiche technique à sections repliables » à 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-specifications-produit
*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

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