Not sure what you want help with but I'll give it a shot anyway...
If you want to set the background color of an individual cell you just do the same as you did when you set the bg of the row...
Set background of row:
(let's assume $row_color = "#FFFFFF" for white)
<tr bgcolor =<?php print($row_color);?>>
Set background of cell:
(let's assume $cell_color = "#000000" for black)
<td bgcolor =<?php print($cell_color);?>>
Note that you just have to put your little php snippet inside the td (cell) tag instead of the tr (row) tag...
Hope I understood your question correctly... 🙂