{# * Custom grouped table view template * Place in: YOUR_THEME/templates/views/views-view-table--YOURVIEWID.html.twig #}
{# Skip the first column in header (grouped column) #} {% for header_cell in header|slice(1) %} {{ header_cell.content }} {% endfor %} {% set current_group = '' %} {% for row in rows %} {# Get the group-by column value (first column assumed as title) #} {% set group_value = row.columns.title.content[0].field_output['#markup']|striptags %} {% if group_value != current_group %} {% set current_group = group_value %} {% endif %} {# Skip first column in data rows #} {% for column in row.columns|slice(1) %} {{ column.content }} {% endfor %} {% endfor %}
{{ group_value }}