{% set row_count = 1 %}

{% for row in rows %}
  {% if loop.index0 % 16 == 0 %}
    <div class="view__rows">
  {% endif %}

  {% set row_attributes = row.attributes|default(create_attribute()) %}
  {% set row_attributes = row_attributes.addClass('view__row view__row--' ~ row_count) %}
  {% set row_count = row_count + 1 %}

  <div{{ row_attributes }}>
    <div class="view__row-content">
      {{- row.content -}}
    </div>
  </div>

  {% if (loop.index0 + 1) % 16 == 0 or loop.last %}
    {# Reset row count for the next group of rows. #}
    {% set row_count = 1 %}
    </div>
  {% endif %}
{% endfor %}
