php - borderColor if null value -
while($row = mysql_fetch_array($query2testing)) { echo "<tr>"; echo "<td><center>$i</td>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['matricno'] . "</td>"; echo "<td><center>" . $row['lc'] . "</td>"; echo "<td>" . $row['code'] . "</td>"; echo "<td>" . $row['subject'] . "</td>"; if(!empty($row['assignment1'])) { echo "<td><center><font color='red'>" . $row['assignment1'] . "</td>"; } echo "<td><center>" . $row['quiz'] . "</td>"; echo "<td><center>" . $row['participation'] . "</td>"; echo "<td><center>" . $row['attendance'] . "</td>"; echo "<td><center>" . $row['exam'] . "</td>"; echo "</tr>"; $i++; } echo "</table>";
this simple code. how make column red if assigment1 null , assigment1 not null blue
style="background-color:red;"
, background-color:blue;
possibly looking for. did not specify how columns should painted might have adjust this.
just insert columns or rows want apply color:
e.g. row (guess header):
echo "<td style="background-color:red;"><center><font color='blue'>" . $row['assignment1'] . "</td>";
Comments
Post a Comment