4 * Default theme implementation to display a table.
7 * - attributes: HTML attributes to apply to the <table> tag.
8 * - caption: A localized string for the <caption> tag.
9 * - colgroups: Column groups. Each group contains the following properties:
10 * - attributes: HTML attributes to apply to the <col> tag.
11 * Note: Drupal currently supports only one table header row, see
12 * https://www.drupal.org/node/893530 and
13 * http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_table/7#comment-5109.
14 * - header: Table header cells. Each cell contains the following properties:
15 * - tag: The HTML tag name to use; either TH or TD.
16 * - attributes: HTML attributes to apply to the tag.
17 * - content: A localized string for the title of the column.
18 * - field: Field name (required for column sorting).
19 * - sort: Default sort order for this column ("asc" or "desc").
20 * - sticky: A flag indicating whether to use a "sticky" table header.
21 * - rows: Table rows. Each row contains the following properties:
22 * - attributes: HTML attributes to apply to the <tr> tag.
23 * - data: Table cells.
24 * - no_striping: A flag indicating that the row should receive no
25 * 'even / odd' styling. Defaults to FALSE.
26 * - cells: Table cells of the row. Each cell contains the following keys:
27 * - tag: The HTML tag name to use; either TH or TD.
28 * - attributes: Any HTML attributes, such as "colspan", to apply to the
30 * - content: The string to display in the table cell.
31 * - active_table_sort: A boolean indicating whether the cell is the active
33 * - footer: Table footer rows, in the same format as the rows variable.
34 * - empty: The message to display in an extra row if table does not have
36 * - header_columns: The number of columns in the header.
37 * - bordered: Flag indicating whether or not the table should be bordered.
38 * - condensed: Flag indicating whether or not the table should be condensed.
39 * - hover: Flag indicating whether or not table rows should be hoverable.
40 * - striped: Flag indicating whether or not table rows should be striped.
41 * - responsive: Flag indicating whether or not the table should be wrapped to
42 * be responsive (using the Bootstrap Framework .table-responsive wrapper).
46 * @see template_preprocess_table()
50 <div class="table-responsive">
55 bordered ? 'table-bordered',
56 condensed ? 'table-condensed',
57 hover ? 'table-hover',
58 striped ? 'table-striped',
59 sticky ? 'sticky-enabled',
62 <table{{ attributes.addClass(classes) }}>
64 <caption>{{ caption }}</caption>
67 {% for colgroup in colgroups %}
68 {% if colgroup.cols %}
69 <colgroup{{ colgroup.attributes }}>
70 {% for col in colgroup.cols %}
71 <col{{ col.attributes }} />
75 <colgroup{{ colgroup.attributes }} />
82 {% for cell in header %}
85 cell.active_table_sort ? 'active',
88 <{{ cell.tag }}{{ cell.attributes.addClass(cell_classes) }}>
99 {% set row_classes = [cycle(['odd', 'even'], loop.index0)] %}
100 <tr{{ row.attributes.addClass(row_classes) }}>
101 {% for cell in row.cells %}
102 <{{ cell.tag }}{{ cell.attributes }}>
112 <td colspan="{{ header_columns }}" class="empty message">{{ empty }}</td>
118 {% for row in footer %}
119 <tr{{ row.attributes }}>
120 {% for cell in row.cells %}
121 <{{ cell.tag }}{{ cell.attributes }}>