Awesome Open Source
Awesome Open Source

Kirby 2 only. There are no plans for Kirby 3 version yet.

Kirby tablex

Kirby tablex - simple table field for Kirby CMS. Advice, features and sugestions welcome.

Kirby tablex GIF


As any field in blueprint:

    label: table
    type: tablex
      maxColumns: 10
      minColumns: 3
      header: false

Options are not required. Defaults are:

        maxColumns: 10
        minColumns: 1
        header: false

Content is then structured as regular yaml arrays:


  - Column 1 heading
  - Column 2 heading
  - Column 3 heading
    - Column 1 row 1
    - Column 2 row 1
    - Column 3 row 1
    - Column 2 row 1
    - Will be nothing after this
    - Column 3 row 2
    - ""
    - nothing
    - Column 3 row 3
    - Column 4 row 1
    - Real
    - Column 3 row 4

In your template you can simply use kirbys toStructure()


<?php $tableX = $page->table()->toStructure(); ?>
<div class="table">
				<?php foreach($tableX->header() as $headerCell): ?>
					<th><?= $headerCell; ?></th>
				<?php endforeach; ?>
			<?php foreach($tableX->table() as $tableRow): ?>
					<?php foreach($tableRow as $tableCell): ?>
						<td><?= $tableCell; ?></td>
					<?php endforeach; ?>
			<?php endforeach; ?>


To install the plugin, please put it in the site/fields directory.
The field folder must be named tablex.



Link to latest version

With Kirby CLI

kirby plugin:install floriankarsten/kirby-tablex

With Git

git clone tablex You can of course have it as submodule.

What we are not sure about - ideas, opinions welcome :)

  • Naming, we chose stupid name kirby-tablex because we were worried about namespace pollution.
  • How to properly pass data from kirby to JS. We are rendering ui only with JS. HTML doesn't come rendered from server. All data is passed to data-attribute of root element and taken from there. We are not sure how to make this safe properly. If you start to put ' and stuff like that into Tablex things will break.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (70,454
kirby (33