title: Change color of date of any particular day column?
body: <p>How can I set the day 'Sunday' date column in red color. While using 'colgroup' can change the background color only but how can I change the date color of one column i.e. Sunday. Ex: If we talk aboyut todays date then change the color of date '4','11','18','25' in red color. Please help... Thanks</p>
  <p><strong>CALENDAR.PHP</strong></p>
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  a
  {
  text-decoration: none;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
     
  &lt;h1 style=&quot; margin-left: 608px; color:brown; &quot;&gt;Calendar (PHP)&lt;/h1&gt;
  
  &lt;?php
  $monthNames = Array(&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;,
                       &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;); 
     
  if (!isset($_GET[&quot;month&quot;]))
  {
      $_GET[&quot;month&quot;]=date(&quot;n&quot;);
      }
      
      if (!isset($_GET[&quot;year&quot;]))
      {
          $_GET[&quot;year&quot;]=date(&quot;Y&quot;);
      }
      
        
      $current_month=$_GET[&quot;month&quot;] ;
      $current_year=$_GET[&quot;year&quot;] ;
      
      
      $prevous_month=$current_month-1;
      $next_month=$current_month+1;
      
      $prevous_year=$current_year-1;
      $next1_year=$current_year+1;
      
      
      $prev_year=$current_year;
      $next_year=$current_year;
      
      if( $prevous_month == 0 )
      {
      
          $prevous_month= 12;
          $prev_year=$current_year-1;
      }
      
      if( $next_month == 13 )
      {
      
          $next_month=1;
          $next_Year=$current_year+1;
      }
      
      echo &quot;&lt;table style='margin-top: 50px; margin-left: 586px;'&gt;
         
            
      &lt;tr&gt;
      &lt;td colspan=1 align='center' style='color:pink'&gt;&lt;button&gt; &lt;a href=&quot;. &quot;?year=&quot; . $prevous_year.&quot; &gt;&lt;&lt;&lt;/a&gt;&lt;/button&gt;&lt;/td&gt;
      
      &lt;td colspan=1 align='center'&gt; &lt;button&gt;&lt;a href=&quot;.&quot;?month=&quot;.$prevous_month.&quot;&amp;year=&quot;.$prev_year.&quot;&gt;&lt;&lt;/a&gt;&lt;/button&gt;&lt;/td&gt;
      
      &lt;td colspan=3 align='center'&gt;&lt;button &gt; &lt;a href= &quot;.&quot;?month=&quot;.date('m').&quot;&amp;year=&quot;.date('Y').&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Today Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/button&gt;&lt;/td&gt;
       
      &lt;td colspan=1 align='center'&gt;&lt;button&gt; &lt;a href=&quot;. &quot;?month=&quot;.$next_month. &quot;&amp;year=&quot; . $next_year.&quot;&gt;&gt;&lt;/a&gt;&lt;/button&gt;&lt;/td&gt;
      
      &lt;td colspan=1 align='center'&gt;&lt;button&gt; &lt;a href=&quot; .&quot;?year=&quot; . $next1_year.&quot;&gt;&gt;&gt;&lt;/a&gt;&lt;/button&gt;&lt;/td&gt;
       
      &lt;/tr&gt;
      
      &lt;tr&gt;
      &lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan=3 align=center style='color:green'&gt;&quot;.date('d').&quot;, &quot;.$monthNames[$current_month-1].&quot;, &quot;. $current_year.&quot;&lt;/td&gt;
      &lt;/tr&gt;
      
      &lt;tr&gt;
      &lt;td align='center' style='color:red'&gt;Sun&lt;/td&gt;
      &lt;td align='center' style='color:blue'&gt;Mon&lt;/td&gt;
      &lt;td align='center' style='color:blue'&gt;Tue&lt;/td&gt;
      &lt;td align='center' style='color:blue'&gt;Wed&lt;/td&gt;
      &lt;td align='center' style='color:blue'&gt;Thu&lt;/td&gt;
      &lt;td align='center' style='color:blue'&gt;Fri&lt;/td&gt;
      &lt;td align='center' style='color:blue'&gt;Sat&lt;/td&gt;
      &lt;/tr&gt;&quot;;
      
      
      
      $time = mktime(0,0,0,$current_month,1,$current_year);
      
      $totle_day = date(&quot;t&quot;,$time);
      
      $thismonth = getdate ($time);
      
      $startday = $thismonth['wday'];
      
      
      for ($i=0; $i&lt;($totle_day+$startday); $i++)
       {
          
         if(($i % 7) == 0 )
      
               echo &quot;&lt;tr&gt;&quot;;
      
         if($i &lt; $startday)
      
              echo &quot;&lt;td&gt;&lt;/td&gt;&quot;;
         
         else 
              
              echo &quot;&lt;td align='center' &gt;&quot;. ($i - $startday +1) . &quot;&lt;/td&gt;&quot;;
      
         if(($i % 7) == 6 )
      
              echo &quot;&lt;/tr&gt;&quot;;
      }
      
      
      echo &quot;&lt;/table&gt;&quot;;
      
      
      
      ?&gt;
      
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>