4 * Theme override for displaying a view as a table.
7 * - attributes: Remaining HTML attributes for the element.
8 * - class: HTML classes that can be used to style contextually through CSS.
9 * - title : The title of this group of rows.
10 * - header: The table header columns.
11 * - attributes: Remaining HTML attributes for the element.
12 * - content: HTML classes to apply to each header cell, indexed by
14 * - default_classes: A flag indicating whether default classes should be
16 * - caption_needed: Is the caption tag needed.
17 * - caption: The caption for this table.
18 * - accessibility_description: Extended description for the table details.
19 * - accessibility_summary: Summary for the table details.
20 * - rows: Table row items. Rows are keyed by row number.
21 * - attributes: HTML classes to apply to each row.
22 * - columns: Row column items. Columns are keyed by column number.
23 * - attributes: HTML classes to apply to each column.
24 * - content: The column content.
25 * - default_classes: A flag indicating whether default classes should be
27 * - responsive: A flag indicating whether table is responsive.
28 * - sticky: A flag indicating whether table header is sticky.
30 * @see template_preprocess_views_view_table()
37 'cols-' ~ header|length,
38 responsive ? 'responsive-enabled',
39 sticky ? 'sticky-enabled',
42 <table{{ attributes.addClass(classes) }}>
43 {% if caption_needed %}
50 {% if (summary is not empty) or (description is not empty) %}
52 {% if summary is not empty %}
53 <summary>{{ summary }}</summary>
55 {% if description is not empty %}
65 {% for key, column in header %}
66 {% if column.default_classes %}
68 set column_classes = [
70 'views-field-' ~ fields[key],
74 <th{{ column.attributes.addClass(column_classes).setAttribute('scope', 'col') }}>
75 {%- if column.wrapper_element -%}
76 <{{ column.wrapper_element }}>
78 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
80 {{ column.content }}{{ column.sort_indicator }}
82 </{{ column.wrapper_element }}>
85 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
87 {{- column.content }}{{ column.sort_indicator }}
97 <tr{{ row.attributes }}>
98 {% for key, column in row.columns %}
99 {% if column.default_classes %}
101 set column_classes = [
105 {% for field in column.fields %}
106 {% set column_classes = column_classes|merge(['views-field-' ~ field]) %}
109 <td{{ column.attributes.addClass(column_classes) }}>
110 {%- if column.wrapper_element -%}
111 <{{ column.wrapper_element }}>
112 {% for content in column.content %}
113 {{ content.separator }}{{ content.field_output }}
115 </{{ column.wrapper_element }}>
117 {% for content in column.content %}
118 {{- content.separator }}{{ content.field_output -}}