Intendi questo?
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript">
var previousTRClicked = null;
function clicca(aTR) {
if (previousTRClicked != null) {
previousTRClicked.className = "notClicked";
} // if (previousTRClicked != null)
aTR.className = aTR.className == "notClicked" ? "clicked" : "notClicked";
previousTRClicked = aTR;
} // function clicca(aTR)
</script>
<style>
.clicked {
background-color:navy;
color:white;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
text-decoration: none;
}
.notClicked {
color:#000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
text-decoration: none;
}
</style>
</head>
<body>
<table border="1">
<tr onClick="clicca(this)" class="notClicked">
<td>
riga 1 - cella 1
</td>
<td>
riga 1 - cella 2
</td>
</tr>
<tr onClick="clicca(this)" class="notClicked">
<td>
riga 2 - cella 1
</td>
<td>
riga 2 - cella 2
</td>
</tr>
<tr onClick="clicca(this)" class="notClicked">
<td>
riga 3 - cella 1
</td>
<td>
riga 3 - cella 2
</td>
</tr>
</table>
</body>
</html>
Bye