se al posto di utilizzare javascript classico puoi usare jqueryCodice PHP:
<html>
<head>
</head>
<body>
<table>
<tr><td>riga1</td></tr>
<tr><td>riga2</td></tr>
</table>
<script type="text/javascript">
var trs = document.getElementsByTagName("tr");
for(x in trs)trs[x].onclick=function(){location.href='http://www.html.it'};
</script>
</body>
</html>
Codice PHP:
$(document).ready(
function(){
$("tr").click(
function(){
location.href='http://www.html.it'
}
)
}
)