Hola
Carxl
Unas pequeñas modificaciones...
Código PHP:
<html>
<head>
<script>
function marcar(obj) {
obj.style.background = (obj.style.background=='') ? 'red' : '';
}
</script>
</head>
<body>
<table>
<tr onclick="marcar(this)">
<td>---</td><td>---</td>
</tr>
<tr onclick="marcar(this)">
<td>---</td><td>---</td>
</tr>
</table>
</body>
</html>
Saludos,