4 * Default theme implementation for displaying a view as a bootstrap 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_bootstrap_table()
37 'cols-' ~ header|length,
38 sticky ? 'sticky-enabled',
43 <div class="table-responsive">
46 <table{{ attributes.addClass(classes) }}>
47 {% if caption_needed %}
54 {% if (summary is not empty) or (description is not empty) %}
56 {% if summary is not empty %}
57 <summary>{{ summary }}</summary>
59 {% if description is not empty %}
69 {% for key, column in header %}
70 {% if column.default_classes %}
72 set column_classes = [
74 'views-field-' ~ fields[key],
78 <th{{ column.attributes.addClass(column_classes).setAttribute('scope', 'col') }}>
79 {%- if column.wrapper_element -%}
80 <{{ column.wrapper_element }}>
82 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
84 {{ column.content }}{{ column.sort_indicator }}
86 </{{ column.wrapper_element }}>
89 <a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
91 {{- column.content }}{{ column.sort_indicator }}
100 {% for row in rows %}
101 <tr{{ row.attributes }}>
102 {% for key, column in row.columns %}
103 {% if column.default_classes %}
105 set column_classes = [
109 {% for field in column.fields %}
110 {% set column_classes = column_classes|merge(['views-field-' ~ field]) %}
113 <td{{ column.attributes.addClass(column_classes) }}>
114 {%- if column.wrapper_element -%}
115 <{{ column.wrapper_element }}>
116 {% for content in column.content %}
117 {{ content.separator }}{{ content.field_output }}
119 </{{ column.wrapper_element }}>
121 {% for content in column.content %}
122 {{- content.separator }}{{ content.field_output -}}