You now can look in almost any website or web application where the background colors are alternating. This is a great (and easy) way to improve the user interface for the end users.
Here’s a quick explanation of what’s going on in the demo file below:
First we set the alternating backgrounds we want to use.
$bg1 = "#f5f5f5";
$bg2 = "#FFFFFF";
Then as we pass through a loop of some kind this code snip rotates the variable $bg to the background colors we set above:
$bg = ($i++ & 1) ? $bg1 : $bg2;
In the example files, we’ve added some javascript to the table Comment if you have any questions or suggestions.
’s to add an additional hover effect as well as some styling to improve the look of the tables.
Similar Posts:
Related Posts:3 Comments
»
Trackback responses to this post
Categories
Search
About
My name is John Veldboom and have been in design and web programing for just over 8 years now. Started off as a hobby in high school but it has developed into a full time job now. I always tell people that if I wasn't doing this at work each day, I would be at home doing it for free. I love it!
Please visit the contact page to drop me a message.
February 7th, 2008 @ 8:33 pm
Exellent article!!
Can you recomend any calendar PHP without SQL?
March 24th, 2008 @ 1:51 pm
I’ve written one about a year ago that I’m hoping to post on here soon. The calendar only includes PHP and some optional javascript. Please check back for the article.
October 20th, 2008 @ 8:17 am
very useful information . . .