django template 编撰隔行更换数据背景颜色

django template 编写隔行更换数据背景颜色隔行变颜色,其实需要使用django template 里的divisibleby, {%

django template 编写隔行更换数据背景颜色

django template 编撰隔行更换数据背景颜色

 

 

隔行变颜色,其实需要使用django template 里的divisibleby,

 

{% if forloop.counter|divisibleby:”2″ %}
<tr class=”背景颜色”>
{% else %}
<tr>
{% endif %}

本文出自 改变网|想改变自己身上某些特质而努力着,转载时请注明出处及相应链接。

本文永久链接: http://www.changeself.com/?p=336