How do I create complex tables?

I want to create complex tables that are flexible in the structure of the number of rows and columns, as well as in the design with CSS classes.

An illustrative example is the following table:
https://www.einfach-fuer-alle.de/artikel/barrierefreie-datentabellen/beispielcode/kreuztabelle-2.html
These options should be realizable:

  • Structuring in caption, thead, tbody, tfoot.
  • merge and separate cells
  • format single cells (font weight, text alignment)
  • highlight single rows and columns in color or frame them with a line

How do you create such tables with Kirby? Is it possible at all?

With the plugin ragi96/table-field I unfortunately don’t get a usable solution, because the functions are very limited and don’t even allow thead or tfoot.

To create a table externally and include it via source code is not an option, because the maintenance of the content by the customer is then no longer possible.

I am happy about any ideas and tips.

There is no plugin for Kirby like what you are looking for.

Addendum: Once a table is created, nothing will change in the structure except the content, since the page is multilingual.
Can the contents be maintained with another function, e.g. with a structure field, which has the exact number of columns? After all, the number of rows can be adjusted dynamically with a structure field.
CSS classes for the layout of the cells I could add with this:

Yes, a structure field can be used for standard data tables. The number of rows is dynamic, but not the number of columns, i.e. each structure field has a fix number of columns.

Plus, you cannot merge/separate cells (but I wonder how well such complex tables would work on mobile anyway).

1 Like

Thanks for the tip. I wanted to be sure if a structure field is the appropriate solution. With some preliminary work, I’m sure I’ll be able to find a compromise and not make the tables too complex. “Less is more” has never hurt.

I use the Boostrap framework and responsive tables: