I have an event listing page. It contains the events for a year. Now "ALL THE ROWS IN THE TABLE" are displayed in alternate colors of grey and white. How do I get to color the current or the next available event row (if there is no event today) "YELLOW". I have stored the event dates in the format "YYYY-MM-DD" which can be compared with the server date and colored. I dont know exactly how it can be done.
I tried using:
$row_color = ($dateToday == $dateThisRow?"yellow"π$row_color == "white"?"grey":"white"))
but it showed all the grey rows as green. Also I could use the same logic but, then wont it just color the row ONLY if the event date corresponds with todays date? What happens if there is no event today - no row is coloured :eek: . But then I would like to color the next available event from today. (if no event today highlight next availabe event dated after todays date).
Given below is the coding i used.
$today = date("Y-m-d");// today's date
$i = 0; //color initializing
while ($row = mysql_fetch_array($retid)) {
$begindate= $row["BEGIN_DATE"];
$bgcolor = ($i++ & 1) ? 'lightgrey' : 'white';
print "<tr bgcolor='$bgcolor'>\n";
}
Is it possible to alternate color the future event rows also π .
Past events (Alt. grey & white)
Present event or next available event (yellow)
Future events (Alt. dark grey & white)
May be I'm asking for too much :o . Any way can someone help me out?