On 6/06/2016 9:39 AM, Mike Dewhirst wrote:
> On 6/06/2016 7:26 AM, Mark Cuevas wrote:
>> I'm using the following, which works, but doesn't break properly. Â I'd
>> like three across for each row. Â How can I accomplish that?
>>
>> {% for director in directors %}
>> <tr class="{% cycle 'odd' 'even' %}">
>> <td>
>> {{ director.full_name }}
>> </td>
>> </tr>
>> {% endfor %}
But I forgot the "break properly"
<table>
<tr>
{% for item in synonyms.synonym_qs %}
<td width="33%">{{
item.name }}</td>
{% if forloop.last %}
</tr>
{% endif %}
{% if forloop.counter|divisibleby:3 %}
</tr><tr>
{% endif %}
{% endfor %}
</table>
You can see I made a synonyms class and populated it with a queryset.