I can\'t for the life of me figure out how to add a For instance: For this specific case you can prepare your array before. So in a loop you will have in each row two variables. Try first example from this site http://twig.sensiolabs.org/doc/templates.html The proper way of doing this is using the batch filter. It is new in 1.12.3. Ref: http://twig.sensiolabs.org/doc/filters/batch.html Something like this would work: An alternative way, that feels much less hacky: every OTHER iteration in a Twig loop.
$numArray = a
<table>
{% for row in numArray|batch(2) %}
<tr>
{% for column in row %}
<td>{{ column }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
<table>
<tr>
{% for num in numArray %}
<td>
{{num}}
</td>
{% if loop.index is even %}
</tr>
<tr>
{% endif %}
{% endfor %}
{% if num|length is odd %}
<td></td>
{% endif %}
</tr>
</table>
<table>
{% for i in range(0, numArray|length-1, 2) %}
<tr>
<td>{{ numArray[i] }}</td>
<td>{{ numArray[i+1]|default("") }}</td>
</tr>
{% endfor %}
</table>