Code

Changes between Version 5 and Version 6 of ColumnizeTag


Ignore:
Timestamp:
10/22/09 03:23:15 (5 years ago)
Author:
glmuelle
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ColumnizeTag

    v5 v6  
    193193            output += '</tr>' 
    194194}}} 
     195 
     196== This is built in already == 
     197 
     198You can achieve alternating columns by using the following built-in cycle tag: 
     199{{{ 
     200            {% for db_entry in db_entries %} 
     201                <tr class="{% cycle 'odd' 'even' %}"> 
     202                    {% for field in db_entry.values %} 
     203                        <td> 
     204                            {{ field }} 
     205                        </td> 
     206                    {% endfor %} 
     207                </tr> 
     208            {% endfor %} 
     209}}} 
     210 
     211Also see: http://blueflavor.com/blog/2008/jul/28/advanced-django-template-tags-and-filters/