I'm having trouble trying to figure out nested for-loops in django.
It keeps throwing me an error on the third endfor-block, telling me "Invalid block tag on line 23: 'endfor', expected 'elif', 'else' or 'endif'. Did you forget to register or load this tag?", but that makes no sense to me.
The code pretty much looks like this:
<body>
<h1>Table</h1>
{% if items1 %}
{% if items2 and items3 and items4 %}
<table style="width:90%">
<tr>
{% for item4 in items4 %}
<th>{{ item4 }}</th>
{% endfor %}
</tr>
{% for item2 in items2 %}
<tr>
{for item4 in items4}
<td>{{ item2 }}</td>
{% endfor %}
</tr>
{% endfor %}
</ul>
{% else %}
Error 1.
{% endif %}
{% else %}
Error 2.
{% endif %}
</body>