I have two lists, that I want to create a table with using jinja and for loops. Using one list and one for loops there are no issues.
<table>
<tr>
<th>Customer</th>
<th>Product</th>
<th>QTY</th>
</tr>
{% for i,e in list_2 %}
<tr>
<td>{{ i }}</td>
<td>{{ e }}</td>
</tr>
{% endfor %}
</table>
Creates
However, when I try to introduce another for loop from another list this happens.
<table>
<tr>
<th>Customer</th>
<th>Pro</th>
<th>QTY</th>
</tr>
{% for i,e in list_2 %}
<tr>
<td>{{ i }}</td>
<td>{{ e }}</td>
{% for i in qtyyyy %}
<td>{{ i }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
This is my ideal result. I have attempted to mess with the loops ending, but have not been able to correctly display it.
question from:https://stackoverflow.com/questions/65600970/how-to-use-nested-loops-to-create-tables