Oh and to answer this:

So if I go with your code then on the 4th time then wont it start on the left instead of the right? Or am I missing your point completly??

no. if you do $i++ it will alternate between assigning left and right to $class. each time $i is incremented, it divides that number by 2 and compares the remainder to 0.

0 / 2 = 0 no remainder:even.

1 / 2 = 0 remainder .5: odd.

2 / 2 = 1 no remainder: even.

3 / 2 = 1 remainder 1: odd.

4 / 2 = 2 no remainder: even.

5 / 2 = 2 remainder 1: odd.

6 / 2 = 3 no remainder: even.

7 / 2 = 3 remainder 1: odd.

8 / 2 = 4 no remainder: even.

9 / 2 = 4 remainder 1: odd.

10 / 2 = 5 no remainder: even.

get it?