{# Block partial: table (standard, comparison, spanning variants) #} {% set variant = block.data.variant | default('standard') %} {% if variant == 'comparison' %} {# ── Comparison table (table_v2) ── #} {% if block.data.header_groups %} {% for c in block.data.base_columns %} {% endfor %} {% for g in block.data.header_groups %} {% endfor %} {% for g in block.data.header_groups %} {% for c in g.columns %} {% endfor %} {% endfor %} {% else %} {% for c in block.data.all_columns %} {% set col_label = c.label | default('') %} {% set col_lc = col_label | lower %} {% endfor %} {% endif %} {% for row in block.data.rows %} {% for c in block.data.all_columns %} {% set col_label = c.label | default('') %} {% set col_lc = col_label | lower %} {% endfor %} {% endfor %}
{{ c.label | e }}{{ g.label | e }}
{{ c.label | e }}
{{ c.label | e }}
{{ row[c.key] | default('') | safe }}
{% elif variant == 'spanning' %} {# ── Spanning table (table_v3 / table_v4) ── #} {% for row in block.data.rows %} {% for cell in row %} 1 %} colspan="{{ cell.colspan }}"{% endif %}{% if cell.rowspan > 1 %} rowspan="{{ cell.rowspan }}"{% endif %}>{{ cell.text | safe }} {% endfor %} {% endfor %}
{% else %} {# ── Standard table ── #} {% if block.data.columns %} {% for col in block.data.columns %} {% set col_lc = (col | lower) %} {% endfor %} {% endif %} {% for row in block.data.rows %} {% for cell in row %} {% set col = block.data.columns[loop.index0] if block.data.columns and loop.index0 < (block.data.columns | length) else '' %} {% set col_lc=(col | lower) %} {% endfor %} {% endfor %}
{{ col | e }}
{{ cell | safe }}
{% endif %}