how can I change a color of a table data () in according to date ?
e.g i have a simple calendar which is created in and each day is in other table data () so if we have 24 january, the previous days in table data should have a background-color:red; and the next days including 24 january should have a background-color:grey;
It's possible to do it in php ?
date('j') to figure out current day number and in the for loop on 24. - 29. row you can compare day number to current day number and set
<td style="background-color: ..."> to what you want. Or better attitude is to make two classes,
.calendar-day-future, and set the
background-color property to them.