使用树枝时,如何向我的表格行添加交替颜色?SYMFONY 2.8 + Bootstrap, - 表中奇偶行的不同颜色
{% if pagination.getTotalItemCount > 0 %}
<div class="top17 panel panel-default">
<table class="table table-responsive table-striped">
{% for item in pagination %}
<tr class="tr-hover redirect" data-url="{{ url('item_details', {'id' : item.id}) }}">
<td class="hidden-xs item-image"><img src="{{ asset(item.webPath) }}"/></td>
<td>{{ item.name }}</td>
<td class="hidden-xs">{{ item.topic }}</td>
<td>{{ item.price }} SM</td>
<td>
<a href="{{ url('buy_item', { 'id' : item.id }) }}" class="btn btn-success">
<span class="glyphicon glyphicon-shopping-cart"></span>
<span class="hidden-xs">{{ "Buy" | trans }}</span>
</a>
</td>
</tr>
{% endfor %}
</table>
</div>
有帮助吗?如果你不能帮助,就过去吧。 – zoore
@Sam Dufel - 感谢您的编辑! – zoore