我有一个PHP表,将华氏度计算为摄氏度,我需要使用Span Class根据某些标准更改摄氏度结果的颜色


I have a PHP table that calculates Fahrenheit into Celsius, I need to use Span Class to change color of the Celsius results based on certain criteria

我该怎么做呢?我知道我必须使用if语句,但我试着把它放在任何地方,我的代码只是搞砸了。

如果C中的值小于等于0,则结果应为蓝色。如果大于或等于100℃,则显示为红色。

这是我的表代码,

<tr>
        <td align="center"><strong>Fahrenheit</strong></td>
        <td align="center"><strong>Celsius</strong></td>
    </tr>
   <?php
   for ($tempFahrenheit = 0; $tempFahrenheit <= 250; $tempFahrenheit++){
   $tempCelsius = (5/9)*($tempFahrenheit-32);
   echo "<tr><td>$tempFahrenheit&degF.</td>";
   echo "<td>$tempCelsius&degC.</td></tr>";   
  }
  ?>
编辑:

这是我试图嵌入到表

中的if语句代码
if ($tempCelsius >= 0)
{
print("<span class='blue'>" . <td>$tempCelsius&degC.</td></tr> . "</span>     <br>");     
}

基本上:

if($tempCelsius <=0){
echo "<td css for BLUE >$tempCelsius&degC.</td></tr>";  
}elseif($tempCelsius <100){
echo "<td css for green >$tempCelsius&degC.</td></tr>";  
}else
echo "<td css for red >$tempCelsius&degC.</td></tr>";  
}