How to display table row with alternate colors using css

Thursday, 3 July 2014

There is a selector in CSS called nth-child. In pure CSS you can do the following:
tr:nth-child(even)
{
    background-color: #000000;
}

Just add this code to your CSS and see the change in your table.
 Source:http://stackoverflow.com/questions/3084261/alternate-table-row-color-using-css

0 comments:

Post a Comment