[Answered ]-Django Template โ€“ Cannot iterate throught this list

2๐Ÿ‘

โœ…

I was expecting to iterate through 31,John,Jacob,1

Then you wouldnโ€™t need that second inner loop. The first loop gives you each sublist/row in the list of rows, while the inner loop iterates through each row, producing each of the items/entries:

{% for rows in student_collection %}
    <tr>
          {% for item in row %}
              <td>{{ item }}</td>
          {% endfor %}
    </tr>
{% endfor %}
๐Ÿ‘คMoses Koledoye

Leave a comment