Forloop with if-statement table layout

Hello @Thijs,

I’d suggest putting the whole code between stripnewlines and for each newline in the table, adding the tag {% newline %} to it.

Like this for instance :

{% stripnewlines %}
|Wagen|Nummerplaat|Chassis|1e inschrijving|CO2|Fiscaal|Out op {% for wagenpark in company.custom.wagenpark %}{% capture wagenin %}{{ wagenpark.in-0 }}{% endcapture %}{% capture wagenout %}{{ wagenpark.out-0 }}{% endcapture %}{% if wagenout == "0.0" or wagenout >= beginboekjaar %}
{% if forloop.first %}
{% newline %}
|:-----|---:|---:|---:|---:|----:|----:|---:|
{% endif %}
{% newline %}
|{{ wagenpark.wagen}}
|{{ wagenpark.nummerplaat }}
|{{ wagenpark.chassisnummer }}
|{{ wagenpark.eerste_inschrijving }}
|{{ wagenpark.co2 }}
|{% if wagenpark.brandstof == "Diesel" %}
    {% if wagenpark.co2 < 61 %}100%{% endif %}
    {% if wagenpark.co2 > 60 and wagenpark.co2 < 106 %}90%{% endif %}
    {% if wagenpark.co2 > 105 and wagenpark.co2 < 116 %}80%{% endif %}
    {% if wagenpark.co2 > 115 and wagenpark.co2 < 146 %}75%{% endif %}
    {% if wagenpark.co2 > 145 and wagenpark.co2 < 171 %}70%{% endif %}
    {% if wagenpark.co2 > 170 and wagenpark.co2 < 196 %}60%{% endif %}
    {% if wagenpark.co2 > 195 %}50%{% endif %}
{% endif %}

{% if wagenpark.brandstof == "Benzine" %}
    {% if wagenpark.co2 < 61 %}100%{% endif %}
    {% if wagenpark.co2 > 60 and wagenpark.co2 < 106 %}90%{% endif %}
    {% if wagenpark.co2 > 105 and wagenpark.co2 < 126 %}80%{% endif %}
    {% if wagenpark.co2 > 125 and wagenpark.co2 < 156 %}75%{% endif %}
    {% if wagenpark.co2 > 155 and wagenpark.co2 < 181 %}70%{% endif %}
    {% if wagenpark.co2 > 180 and wagenpark.co2 < 206 %}60%{% endif %}
    {% if wagenpark.co2 > 205 %}50%{% endif %}
{% endif %}

{% if wagenpark.brandstof == "Elektrisch" %}
120%
{% endif %}
|{{ wagenpark.out }}
{% endif %}
{% endfor %}
{% endstripnewlines %} 

More info on newlines here :