
- MODX 3
- PHP 8.2
- Vue 3


Two-column table for technical data. Optional title and intro above the table.

Информация
Requires PageBuilder Pro.
table field edits in the inspectorSpecifications table field: parameter and value columns. Striped rows enables zebra styling.
| Parameter | Value |
|---|---|
| key | spec_table |
| Layer | Pro |
| Category | content (content) |
| Chunk | pagebuilderpro_spec_table |
| Requires | pro |
Fill these fields in the section inspector. Field types are documented in the field types reference.
title) Type text. Optional.
intro) Type textarea. Optional.
specs) Type table. Required. Table with fixed columns.
Columns:
| Column | Type | Label |
|---|---|---|
label | text | Parameter |
value | text | Value |
The inspector supports group rows (_pbGroup), cell merges (_span on label / value), and a preview under the grid.
striped) Type yesno. Optional. Yes/no toggle.
HTML table pb-spec-table. With striped, the class pb-spec-table--striped is added. Groups use pb-spec-table__row--group. Rows fully covered by a span use pb-spec-table__row--span-cont.
Example payload after save. On output Pro adds spec_rows via TableCells::present() (_pb_cells on each row):
{
"title": "Specifications",
"intro": "Main product parameters.",
"striped": true,
"specs": [
{ "label": "Dimensions", "value": "", "_pbGroup": true },
{
"label": "Storage",
"value": "128 GB",
"_span": { "value": { "colspan": 1, "rowspan": 2 } }
},
{ "label": "With case", "value": "" },
{ "label": "Color", "value": "Graphite" }
]
}Fenom chunk pagebuilderpro_spec_table uses $spec_rows, otherwise $specs:
{set $rows = $spec_rows|default:($specs|default:[])}
<section class="pb-section pb-section--spec-table pb-spec-table{if $striped} pb-spec-table--striped{/if}{if $cssClass} {$cssClass|escape}{/if}" data-pb-section="spec_table"{if $id} id="pb-{$id|escape}"{/if}>
<div class="pb-section__inner pb-spec-table__inner">
{if $title}
<h2 class="pb-heading pb-spec-table__title">{$title|escape}</h2>
{/if}
{if $intro}
<p class="pb-spec-table__intro">{$intro|escape}</p>
{/if}
{if $rows && ($rows | length) > 0}
<div class="pb-spec-table__scroll">
<table class="pb-spec-table__table">
<thead>
<tr>
<th scope="col">{'pagebuilder_fe_spec_param' | lexicon}</th>
<th scope="col">{'pagebuilder_fe_spec_value' | lexicon}</th>
</tr>
</thead>
<tbody>
{foreach $rows as $row}
{if $row._pbGroup}
<tr class="pb-spec-table__row--group">
<th colspan="2" scope="colgroup">{$row.label|default:''|escape}</th>
</tr>
{elseif $row._pb_cells.label.hidden && $row._pb_cells.value.hidden}
<tr class="pb-spec-table__row--span-cont" aria-hidden="true"></tr>
{else}
<tr>
{if !$row._pb_cells.label.hidden}
<th scope="row" colspan="{$row._pb_cells.label.colspan|default:1}" rowspan="{$row._pb_cells.label.rowspan|default:1}">{$row.label|default:''|escape}</th>
{/if}
{if !$row._pb_cells.value.hidden}
<td colspan="{$row._pb_cells.value.colspan|default:1}" rowspan="{$row._pb_cells.value.rowspan|default:1}">{$row.value|default:''|escape}</td>
{/if}
</tr>
{/if}
{/foreach}
</tbody>
</table>
</div>
{else}
<p class="pb-spec-table__empty">{'pagebuilder_fe_spec_empty' | lexicon}</p>
{/if}
</div>
</section>Cell text is escaped (|escape). HTML from the editor is not executed on the site.