4 * Default theme implementation 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 * - caption_needed: Is the caption tag needed.
15 * - caption: The caption for this table.
16 * - accessibility_description: Extended description for the table details.
17 * - accessibility_summary: Summary for the table details.
18 * - responsive: Whether or not to use the .table-responsive wrapper.
19 * - rows: Table row items. Rows are keyed by row number.
20 * - attributes: HTML classes to apply to each row.
21 * - columns: Row column items. Columns are keyed by column number.
22 * - attributes: HTML classes to apply to each column.
23 * - content: The column content.
24 * - bordered: Flag indicating whether or not the table should be bordered.
25 * - condensed: Flag indicating whether or not the table should be condensed.
26 * - hover: Flag indicating whether or not table rows should be hoverable.
27 * - striped: Flag indicating whether or not table rows should be striped.
28 * - responsive: Flag indicating whether or not the table should be wrapped to
29 * be responsive (using the Bootstrap Framework .table-responsive wrapper).
33 * @see template_preprocess_views_view_table()
37 <div class="table-responsive">
42 bordered ? 'table-bordered',
43 condensed ? 'table-condensed',
44 hover ? 'table-hover',
45 striped ? 'table-striped',
46 sticky ? 'sticky-enabled',
49 <table{{ attributes.addClass(classes) }}>
50 {% if caption_needed %}
57 {% if (summary is not empty) or (description is not empty) %}
59 {% if summary is not empty %}
60 <summary>{{ summary }}</summary>
62 {% if description is not empty %}
72 {% for key, column in header %}
73 {% if column.default_classes %}
75 set column_classes = [
77 'views-field-' ~ fields[key],
81 <th{{ column.attributes.addClass(column_classes).setAttribute('scope', 'col') }}>
82 {%- if column.wrapper_element -%}
83 <{{ column.wrapper_element }}>
85 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
87 {{ column.content }}{{ column.sort_indicator }}
89 </{{ column.wrapper_element }}>
92 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
94 {{- column.content }}{{ column.sort_indicator }}
103 {% for row in rows %}
104 <tr{{ row.attributes }}>
105 {% for key, column in row.columns %}
106 {% if column.default_classes %}
107 {% set column_classes = [ 'views-field' ] %}
108 {% for field in column.fields %}
109 {% set column_classes = column_classes|merge(['views-field-' ~ field]) %}
112 <td{{ column.attributes.addClass(column_classes) }}>
113 {%- if column.wrapper_element -%}
114 <{{ column.wrapper_element }}>
115 {% for content in column.content %}
116 {{ content.separator }}{{ content.field_output }}
118 </{{ column.wrapper_element }}>
120 {% for content in column.content %}
121 {{- content.separator }}{{ content.field_output -}}