html - How to make strip td in css? -
how make strip td
different background-color
using css?
.backgroundi:nth-of-type(2n) { background-color: #3366cc; height: 60px; width: 60px; } .backgroundi:nth-of-type(n+1) { background-color: #775577; height: 60px; width: 60px; }
<tr ng-repeat="comment in post.comments"> <td> <div class="backgroundi"></div> </td> <td> <div class="c" style="margin-left:15px; margin-top:25px">hello</div> </td> </tr>
first, dont know code complete or not need add <table> </table>
tag , put code code inside tag. here code sample you.
tr:nth-child(even) {background: #ffb3b3} tr:nth-child(odd) {background: #e2e2e2}
<table> <tr ng-repeat="comment in post.comments" > <td ><div class="backgroundi">background</div></td> <td><div class="c" style="margin-left:15px; margtop:25px">hello</div></td> </tr> <tr> <td><div class="c" style="margin-left:15px; margtop:25px">test</div></td> <td><div class="c" style="margin-left:15px; margtop:25px">test stripe</div></td> </tr> </table>
now, going here pointing odd , rows table , applying css on them. parent class table. try , best. happy coding :)
Comments
Post a Comment