How can I go about doing this? I know I have to use an if statement, but I have tried placing it everywhere and my code just gets messed up.
The criteria is if the value in C is less than or equal to 0, the result should be blue. If it is greater than or equal to 100 C, it's displayed in red. All other temperatures in C should be green.
This is my table code,
<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°F.</td>";
echo "<td>$tempCelsius°C.</td></tr>";
}
?>
Aucun commentaire:
Enregistrer un commentaire