Interesting because my code doesn't work just as well, although I used the tr element ...
<style> .list tr:nth-child(even) { background: #E0DDF0; } </style> <table class="list"> <thead> <tr> <td align="left"><font color="#1E4262"><h2>List of books</h2></font></td> <td></td> </tr> <tr> <th style="width: 350px;"> Name </th> <th style="width: 110px;"> Writer </th> <th style="width: 110px;"> Date </th> <th colspan="5" style="width: 45px;"> Actions </th> </tr> </thead> {% for d in titles %} <tbody> <tr > <td class="listLeft" > {{ d.title | upper }} </td> <td> {{ d.idUser.name }} </td> <td> {{ d.dateCreation | date ('dm-Y') }} </td> </tr> </tbody> {% endfor %} </table>
Can anyone see please? Thanks.
source share