djangosnippets.org: Latest snippets tagged with 'groupby'https://djangosnippets.org/tags/groupby/2011-02-17T10:02:00.611304-06:00Group sequence into rows and columns for a TABLE
2011-02-17T10:02:00.611304-06:00davidwtbuxtonhttps://djangosnippets.org/snippets/2361/<p>Two template tag filters that can be used to create a table from a sequence.
</p>
<pre><code><table>
{% for row in object_list|groupby_columns:3 %}
<tr>
{% for obj in row %}
<td>{{ obj }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
</code></pre><p>The example above would create a table where items read …</p>
Freely redistributable