Hola
PP2
Prueba este código:
Código PHP:
<html>
<head>
<script type="text/javascript">
function marcar(obj,val) {
tab = document.getElementById('tabla');
col = obj.parentNode;
for (i=0; ele=col.getElementsByTagName('td')[i]; i++)
if (ele==obj) num=i;
for (i=0; ele=tab.getElementsByTagName('tr')[i]; i++)
ele.getElementsByTagName('td')[num].style.background = (val) ? 'red' : '';
}
</script>
</head>
<body>
<table id="tabla">
<tr>
<td onmouseover="marcar(this,true)" onmouseout="marcar(this,false)">1</td>
<td onmouseover="marcar(this,true)" onmouseout="marcar(this,false)">2</td>
</tr>
<tr>
<td onmouseover="marcar(this,true)" onmouseout="marcar(this,false)">1</td>
<td onmouseover="marcar(this,true)" onmouseout="marcar(this,false)">2</td>
</tr>
</table>
</body>
</html>
Saludos,