you can use forloop.counter and do something like:
<table> <tr> {% for person in people %} <td>{{ person }}</td> {% if not forloop.last and forloop.counter == 3 or forloop.counter == 6 %} </tr> <tr> {% endif %} {% endfor %} </tr> </table>
or collapse your own template tag. One here looks like it is doing what you want.
it looks like this SO question is related:
Mark one query in 2 div columns (django template)
[EDIT]: Must be a “counter”, not a “count”
source share