Ahora sí:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
onload=function(){
var r = document.getElementsByTagName('tr');
for (var i = 0; i < r.length; i++) {
r[i].onmouseover = function() {this.className += ' hilite';};
r[i].onmouseout = function() {this.className = this.className.replace('hilite', '');}}
}
</script>
<style>
.tabla tr.hilite {
background-color: #DFE7F2;
color: #000000;
}
</style>
</head>
<body>
<table class="tabla">
<tr>
<td><a href="#">celda 1</a></td>
<td>celda 2</td>
</tr>
<tr>
<td>celda 1</td>
<td>celda 2</td>
</tr>
<tr>
<td>celda 1</td>
<td>celda 2</td>
</tr>
</table>
</body>
</html>
Faltaba inicializar la asignación con el onload de la página.