title: Change <td> color on condition
body: <p>Hi i have this PHP which take sql query divide it into two columns and print table. Now i need to change color of TD where value > 0. I've add color change by class. It's working but not correct. It change color of whole string but not TD cell. </p>
  
  <pre><code>$stmt=ociparse($olink, $sql);
  if (!$stmt) {
      $e = oci_error($olink); 
      trigger_error(htmlentities($e['message']), E_USER_ERROR);
  }
  $r =ociexecute($stmt,OCI_NO_AUTO_COMMIT);
  if (!$r) {
      $e = oci_error($stmt);  // For oci_execute errors pass the statement handle
      print htmlentities($e['message']);
      print "\n&lt;pre&gt;\n";
      print htmlentities($e['sqltext']);
      printf("\n%".($e['offset']+1)."s", "^");
      print  "\n&lt;/pre&gt;\n";
  }
  $ncols = oci_num_fields($stmt);
  $cur_dt = 1;
  echo "&lt;TABLE border=\"1\" width=\"100%\" align='center' cellspacing='0' cellpadding='0'  class=\"sortable\"&gt;";
  /* echo "\n&lt;tr&gt;"; */
  for ($i = 1; $i &lt;= $ncols; $i++) {
  echo "&lt;th bgcolor=\"#2B75C1\" class=\"header\"&gt;".oci_field_name($stmt, $i)."&lt;/th&gt;";
  }
  for ($i = 1; $i &lt;= $ncols; $i++) {
  echo "&lt;th bgcolor=\"#2B75C1\" class=\"header\"&gt;".oci_field_name($stmt, $i)."&lt;/th&gt;";
  }
  $str=1;
  while (oci_fetch($stmt)) {
  if ($str % 2 == 1)
  {
      echo "\n";
  echo "&lt;tr";
  $hrr="";
  echo "&gt;";
  }
  for ($i = 1; $i &lt;= $ncols; $i++) {
  echo "&lt;td";
  echo $hrr;
  if (oci_result($stmt, 2) &gt;= $cur_dt)  {$hrr= " class=\"hour\"";echo $hrr;}
  echo "&gt;";
  echo oci_result($stmt, $i);
  }
  echo "&lt;/td&gt;";
  if ($str % 2 == 0) {echo "&lt;/tr&gt; \n";}
  $str++;
  }
  echo "&lt;/TABLE&gt;";
  oci_close($olink);
  ?&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="http://i.piccy.info/i9/575f84b45d9e212e131116bfbbb59e2d/1424343095/9041/868927/Region.png" rel="nofollow">0 in second column should be blue, but it ged "hour" class and change color</a></p>