From a PHP viewpoint, without an inkling of what your code looks like to generate the table in question, it's difficult for us to answer. If the table rows are generated via some sort of loop (whether it's reading rows from the DB or a foreach() on an array), the general principle is to increment a counter variable on each loop, and use modulus arithmetic with the "%" operator to determine if it's an odd or even row, and assign the desired html/css class or explicit styling as desired.
Alternatively, you could use the CSS method weedpacket linked to above.