Dynamic Tables
This snippet lets you create tables that automatically adjust to match the length of your field values. The generated table will have one column per field.
Last updated
Was this helpful?
This snippet lets you create tables that automatically adjust to match the length of your field values. The generated table will have one column per field.
Last updated
Was this helpful?
Add each field to the setup line which determines the number of table rows:
For each field you want in the table, add <field>|length
in between the [
and ]
, and separate with commas
Create the table structure with dynamic content:
Header one
Header two
Header three
{%tr for i in range(max_length) %}
{{ <field>[i] if i < <field>|length else "" }}
{{ <field>[i] if i < <field>|length else "" }}
{{ <field>[i] if i < <field>|length else "" }}
{%tr endfor %}
Add header columns to match your table structure. These can be plain text, or make use of a field value using {{ <field> }}
.
Add columns in between the table template rows (third row) to match your desired table and fill with field values: