diff --git a/modules/statistics/templates/statistics.twig b/modules/statistics/templates/statistics.twig
index 202a964ec9c44d9066d49b3e0862d0ab555a14a3..576a572d2a36c76bf82344a56383eb18fbfdcf2c 100644
--- a/modules/statistics/templates/statistics.twig
+++ b/modules/statistics/templates/statistics.twig
@@ -193,10 +193,9 @@
                     <th>{{ keyName }}</th>
                     {% endfor %}
                 </tr>
-                {% set i = 0 %}
                 {% for slot, dd in debugdata %}
 
-                {% if i % 2 == 0 %}
+                {% if loop.index0 % 2 == 0 %}
                     {% set class = 'even' %}
                 {% else %}
                     {% set class = 'odd' %}