<div{{ attributes.addClass(component_wrapper_class) }}>

  {{ title_prefix }}
  {% if component_wrapper.display_title.value == 1 %}
    {% if label %}
      <h2{{ title_attributes.addClass('title') }}>{{ label }}</h2>
    {% endif %}
  {% endif %}
  {{ title_suffix }}

  {% if header is not empty %}
    <div class = "component-wrapper--header">
      {{ header }}
    </div>
  {% endif %}

  <div{{ content_attributes.addClass('component-wrapper--content') }}>
    <div class="field-table">
      <table>
        <thead>
        <tr>
          {% for col in cols %}
            <th>{{ col['title'] }}</th>
          {% endfor %}
        </tr>
        </thead>
        {% set max = 0 %}
        <tbody>
        {% for key, col in cols %}
          {% set cells = col['cells'] %}
          {% if max < cells|length %}
            {% set max = cells|length - 1 %}
          {% endif %}
        {% endfor %}
        {% for i in 0..max %}
          <tr>
            {% for col in cols %}
              {% set cells = col['cells'] %}
              <td>{{ cells[i]['value'] }}</td>
            {% endfor %}
          </tr>
        {% endfor %}
        </tbody>
      </table>
    </div>
  </div>

  {% if footer is not empty %}
    <div class = "component-wrapper--footer">
      {{ footer }}
    </div>
  {% endif %}

</div>
