ragi96/table-field

Table-Field is a kirby 3 field plugin to make nice extendable tables

Installs: 11 322

Dependents: 0

Suggesters: 0

Security: 0

Stars: 22

Watchers: 2

Forks: 7

Open Issues: 7

Language:Vue

Type:kirby-plugin

1.1.3 2022-08-16 07:19 UTC

This package is auto-updated.

Last update: 2024-04-16 10:54:10 UTC


README

A Table Field for Kirby V3

Table Field Preview

Usage

As any Kirby field:

  fields:
    table:
      label: table
      type: table
      maxColumns: 5
      minColumns: 2

Options are not required. Defaults are:

        maxColumns: 5
        minColumns: 2

Content is structured like an yaml array

In your template you can simply use the function toTable()

Example:

<?php $table = $data->table()->toTable(); ?>
<?php if($table != null): ?>
  <table>
    <?php foreach ($table as $tableRow): ?>
      <tr>
        <?php foreach ($tableRow as $tableCell): ?>
          <td><?= $tableCell; ?></td>
        <?php endforeach; ?>
      </tr>
    <?php endforeach; ?>
  </table>
<?php endif; ?>

Installation

To install the plugin, please put it in the site/plugins directory.
The field folder must be named table-field.

Download

Link to latest version https://github.com/ragi96/table-field/releases/latest

With Git

git clone https://github.com/ragi96/table-field/releases.git table-field

Composer

Composer require ragi96/table-field