konunun php ile pek bir ilgisi yok. açık bir şekilde yazmıştım ama çözümü okumadınız herhalde.
<script type="text/javascript">
function RenkDegistir()
{
document.getElementById('mycell').style.backgroundColor="#00ffff";
}
</script>
<table>
<tr>
<td id="mycell" bgcolor="#0099FF" onClick="RenkDegistir()" >
sdsS
</td>
</tr>
</table>