bootstrap_storybook-8.x-2.0/src/components/table/table.twig

src/components/table/table.twig
{#
/**
 * @file
 * Template for a Table component.
 *
 * Available config:
 * - utility_classes: An array of utility classes.
 */
#}

{% set classes = [
  'table',
]|merge(utility_classes ? utility_classes : []) %}

<table{{ attributes.addClass(classes) }}>
  {% if caption %}
    <caption>{{ caption }}</caption>
  {% endif %}

  {% for colgroup in colgroups %}
    {% if colgroup.cols %}
      <colgroup{{ colgroup.attributes }}>
        {% for col in colgroup.cols %}
          <col{{ col.attributes }} />
        {% endfor %}
      </colgroup>
    {% else %}
      <colgroup{{ colgroup.attributes }} />
    {% endif %}
  {% endfor %}

  {% if header %}
    <thead>
    <tr>
      {% for cell in header %}
      {%
        set cell_classes = [
        cell.active_table_sort ? 'is-active',
      ]
      %}
      <{{ cell.tag }}{{ cell.attributes.addClass(cell_classes) }}>
      {{- cell.content -}}
    </{{ cell.tag }}>
    {% endfor %}
    </tr>
    </thead>
  {% endif %}

  {% if rows %}
    <tbody>
    {% for row in rows %}
      {%
        set row_classes = [
        not no_striping ? cycle(['odd', 'even'], loop.index0),
      ]
      %}
    <tr{{ row.attributes.addClass(row_classes) }}>
      {% for cell in row.cells %}
        <{{ cell.tag }}{{ cell.attributes }}>
        {{- cell.content -}}
        </{{ cell.tag }}>
      {% endfor %}
      </tr>
    {% endfor %}
    </tbody>
  {% elseif empty %}
    <tbody>
    <tr class="odd">
      <td colspan="{{ header_columns }}" class="empty message">{{ empty }}</td>
    </tr>
    </tbody>
  {% endif %}
  {% if footer %}
    <tfoot>
    {% for row in footer %}
    <tr{{ row.attributes }}>
      {% for cell in row.cells %}
        <{{ cell.tag }}{{ cell.attributes }}>
        {{- cell.content -}}
        </{{ cell.tag }}>
      {% endfor %}
      </tr>
    {% endfor %}
    </tfoot>
  {% endif %}
</table>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc