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()
35 'cols-' ~ header|length,
36 responsive ? 'responsive-enabled',
37 sticky ? 'sticky-enabled',
40 <table{{ attributes.addClass(classes) }}>
41 {% if caption_needed %}
48 {% if (summary is not empty) or (description is not empty) %}
50 {% if summary is not empty %}
51 <summary>{{ summary }}</summary>
53 {% if description is not empty %}
63 {% for key, column in header %}
64 {% if column.default_classes %}
66 set column_classes = [
68 'views-field-' ~ fields[key],
72 <th{{ column.attributes.addClass(column_classes).setAttribute('scope', 'col') }}>
73 {%- if column.wrapper_element -%}
74 <{{ column.wrapper_element }}>
76 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
78 {{ column.content }}{{ column.sort_indicator }}
80 </{{ column.wrapper_element }}>
83 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
85 {{- column.content }}{{ column.sort_indicator }}
95 <tr{{ row.attributes }}>
96 {% for key, column in row.columns %}
97 {% if column.default_classes %}
99 set column_classes = [
103 {% for field in column.fields %}
104 {% set column_classes = column_classes|merge(['views-field-' ~ field]) %}
107 <td{{ column.attributes.addClass(column_classes) }}>
108 {%- if column.wrapper_element -%}
109 <{{ column.wrapper_element }}>
110 {% for content in column.content %}
111 {{ content.separator }}{{ content.field_output }}
113 </{{ column.wrapper_element }}>
115 {% for content in column.content %}
116 {{- content.separator }}{{ content.field_output -}}