I have an SQL SELECT statement and after executing this I have a While statement to display every record in a div. These div are all under one another and I want the divs to alternate in color. So like this:
Result 1 = white div
Result 2 = grey div
Result 3 = white div
Result 4 = grey div.
I actually have no idea how to accomplish this, anyone who could help me?
Thanks!
EDIT: I can actually come up with the theory do to this, even numbers white, uneven numbers grey, but how do I code this?
You can do it just with css, like this:
This will work just make sure you add
class="resultdiv"to all divs you create in the while loop.