Content · Gutenberg

Accordion Table block for WordPress

A data table where each row expands on click to reveal rich detail content — specs, bullet points, sub-data, or notes. Perfect for pricing tiers, product specs, API docs, and comparison matrices.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

A data table where each row expands on click to reveal rich detail content — specs, bullet points, sub-data, or notes. Perfect for pricing tiers, product specs, API docs, and comparison matrices.

Inspector panels on this block: Columns, Rows, Behaviour, Appearance. Those titles come from index.js, not from a shared template.

Behavior controls: “L” options: C, R; “Detail type” options: Bullet list, Text paragraph; “Expand icon” options: Chevron (▼), Plus (+), Arrow (▶); “Expand icon position” options: Right, Left.

Where to find it

Gutenberg inserter → Content → search “Accordion Table” (block name `blockenberg/accordion-table` in block.json). Style it in the sidebar after insert.

How to use Accordion Table block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Accordion Table”, insert it. Category: Content.
  3. Configure inspector controls that exist on this block. Open Columns. Set “L”, “Badge text (optional)”, “Highlight this row”, “Detail section title”.
  4. Check the published page. The view script reads HTML data attributes: data-opts, data-rendered. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
LSelect control; the chosen value is saved on the block. Options: C; R.
Badge text (optional)Text field in the inspector.
Highlight this rowOn/off toggle in the inspector.
Detail section titleText field in the inspector.
Detail typeSelect control; the chosen value is saved on the block. Options: Bullet list; Text paragraph.
Allow multiple rows open simultaneouslyOn/off toggle in the inspector. Off by default. Saved as `allowMultiple`.
Show row numbersOn/off toggle in the inspector. Off by default. Saved as `showRowNumbers`.
Striped rowsOn/off toggle in the inspector. On by default. Saved as `stripedRows`.
Expand iconSelect control; the chosen value is saved on the block. Options: Chevron (▼); Plus (+); Arrow (▶). block.json default: chevron. Saved as `expandIcon`.
Expand icon positionSelect control; the chosen value is saved on the block. Options: Right; Left. block.json default: right. Saved as `expandIconPosition`.
Animation duration (ms)Numeric range control in the inspector. Range 80–600. block.json default: 240. Saved as `animDuration`.
Max width (px)Numeric range control in the inspector. Range 300–1400. block.json default: 900. Saved as `maxWidth`.
Border radius (px)Numeric range control in the inspector. Range 0–24. block.json default: 10. Saved as `borderRadius`.
Cell padding VNumeric range control in the inspector. Range 6–32. block.json default: 14. Saved as `cellPaddingV`.
Cell padding HNumeric range control in the inspector. Range 6–40. block.json default: 16. Saved as `cellPaddingH`.
Padding topNumeric range control in the inspector. Range 0–120. block.json default: 0. Saved as `paddingTop`.
Padding bottomNumeric range control in the inspector. Range 0–120. block.json default: 0. Saved as `paddingBottom`.
Typography — HeaderShared Blockenberg typography popover (family, size, weight, spacing). Saved as `headerTypo`.
CellsShared Blockenberg typography popover (family, size, weight, spacing). Saved as `cellTypo`.
DetailShared Blockenberg typography popover (family, size, weight, spacing). Saved as `detailTypo`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Header backgroundColor control in the inspector. block.json default: #f8fafc. Saved as `headerBg`.
Header textColor control in the inspector. block.json default: #374151. Saved as `headerColor`.
Row backgroundColor control in the inspector. block.json default: #ffffff. Saved as `rowBg`.
Row alt backgroundColor control in the inspector. block.json default: #f9fafb. Saved as `rowAltBg`.
Row textColor control in the inspector. block.json default: #1f2937. Saved as `rowColor`.
Row hoverColor control in the inspector. block.json default: #f0f4ff. Saved as `rowHoverBg`.
Highlighted row bgColor control in the inspector. block.json default: #f0f0ff. Saved as `highlightRowBg`.
Highlighted row borderColor control in the inspector. block.json default: #6366f1. Saved as `highlightRowBorder`.
Detail panel bgColor control in the inspector. block.json default: #f8fafc. Saved as `detailBg`.
Detail textColor control in the inspector. block.json default: #374151. Saved as `detailColor`.
Table borderColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.
Icon colorColor control in the inspector. block.json default: #9ca3af. Saved as `iconColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Accordion Table block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Accordion Table”. It sits under Content. After insert, open Columns and set “L”, “Badge text (optional)”, “Highlight this row”, “Detail section title”.

What makes Accordion Table different from other Blockenberg blocks?

A data table where each row expands on click to reveal rich detail content — specs, bullet points, sub-data, or notes. Perfect for pricing tiers, product specs, API docs, and comparison matrices. Inspector labels on this block include “L”, “Badge text (optional)”, “Highlight this row”, “Detail section title”.

Is the Accordion Table Gutenberg block free?

Yes. Accordion Table ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Accordion Table to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Columns, Rows, Behaviour, Appearance).

Related content blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Accordion Table from the Gutenberg inserter.

Get Blockenberg