dsfr4drupal-1.x-dev/templates/system/table.html.twig
templates/system/table.html.twig
{% set wrapper_attributes = wrapper_attributes|default(create_attribute()) %}
{# Add border between table cells. #}
{% if bordered %}
{% set wrapper_attributes = wrapper_attributes.addClass('fr-table--bordered') %}
{% endif %}
{# Display the caption below the table. #}
{% if caption_bottom %}
{% set wrapper_attributes = wrapper_attributes.addClass('fr-table--caption-bottom') %}
{% endif %}
{# Hide caption. #}
{% if caption_hide %}
{% set wrapper_attributes = wrapper_attributes.addClass('fr-table--no-caption') %}
{% endif %}
{# Define a caption description. #}
{% if caption_description %}
{% set caption %}
{{ caption }}
<div class="fr-table__caption__desc">{{ caption_description }}</div>
{% endset %}
{% endif %}
{# Enable multiline mode for table cells. #}
{% if multiline %}
{% set wrapper_attributes = wrapper_attributes.addClass('fr-table--multiline') %}
{% endif %}
{# Disable table scrolling. #}
{% if no_scroll %}
{% set wrapper_attributes = wrapper_attributes.addClass('fr-table--no-scroll') %}
{% endif %}
{# Manage size variant. #}
{% if variant == 'sm' or variant == 'lg' %}
{% set wrapper_attributes = wrapper_attributes.addClass('fr-table--' ~ variant) %}
{% endif %}
<div{{ wrapper_attributes.addCLass('fr-table') }}>
{% if table_header %}
<div class="fr-table__header">
{{ table_header }}
</div>
{% endif %}
<div class="fr-table__wrapper">
<div class="fr-table__container">
<div class="fr-table__content">
{% include '@system/templates/table.html.twig' %}
</div>
</div>
</div>
{% if table_footer %}
<div class="fr-table__footer">
{{ table_footer }}
</div>
{% endif %}
</div>
{{ attach_library('dsfr4drupal/component.table') }}
