What do mean by alternate color?
Do you want to display adjacent col/row with different color?
PHP can generate stuff like that fairly easily...
You get it. Just use the row() function to add a row. Presto! Alternating rows with very little effort. Change $colours to get different coloured rows.
I am not sure am I understand good your question but I will solve this with different css and simple php in head of html. In that case you can change and include more colors and differences with few lines in php. For example:
1. Create three different css - pink.css, blue.css and white.css
2. Insert this php in head of your page:
3. If you didn't chose any number in url the brower will load white.css
4. If you chose e.g. www.your_page.php?color=1 browser will load pink.css
Of course you can have one main css for all documents and php can include and switch only addition css.
Firstl thank you for the reply.
Can somebody explain this php coding to me
Here this code determines whether your variable $ac_sw1 contains odd number or even number.
depending on that it returns "even" or "odd". I guess they are names of the style in your css.
i found one more method to do so..
Yup that should work just fine too. There isn't just one method you know .