Creating Alternating colors in a table

It’s pretty awesome to have a table with alternating colors for the rows for readability.

You can create the stylesheet as mentioned here :

table { background-color: teal } table, td, th { border:1px solid green; border-collapse:collapse; vertical-align: middle; text-align: center; } tr.d0 td { background-color: #CC9999; color: black; } tr.d1 td { background-color: #9999CC; color: black; } th { background-color:green; color:white; text-align: center; vertical-align: middle; }

Now when you display the table, lets say in a php script, you can use that as shown below :

"."".$some_value.""; echo "".$some_other_value.""; } //loop completed... ?>