Ah, figured it out as per this thread: How to enable table block? - #3 by toddz
I was missing “snippets/blocks/table.php” in my snippets folder.
Snippet (snippets/blocks/table.php)
<?php
$rows = $block->rows()->toStructure();
if($rows):
?>
<table class="table">
<tr>
<th>This snippet is linked!</th>
</tr>
<?php foreach($rows as $row): ?>
<tr>
<td><?= $row->name()->html() ?></td>
<td><?= $row->role()->html() ?></td>
<td><?= $row->year()->html() ?></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
Plugin (plugins/section-block/snippets/blocks/sections.php)
<div class="row <?= $block->title()->lower() ?>">
<div class="title">
<h2><?= $block->title() ?></h2>
</div>
<div class="blocks">
<?= $block->sectionBlocks()->toBlocks() ?>
</div>
</div>
Blueprint (blueprint/blocks/section.yml)
name: Section
icon: add
fields:
title:
type: text
required: true
sectionBlocks:
label: Blocks
type: blocks
fieldsets:
- heading
- text
- image
- list
- table
Blueprint (blueprint/blocks/table.yml)
name: People
icon: menu
preview: table
fields:
rows:
type: structure
columns:
name:
width: 1/3
role:
width: 1/3
year:
width: 1/3
align: right
fields:
name:
type: text
width: 1/3
role:
type: text
width: 1/3
year:
type: number
width: 1/3
align: right
Hope this helps!