Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>mouse over cells</title>
<style type="text/css">
#mytable {
width:371px;
background-color:#000;
}
#tr0 {
background-color:#fff;
}
#tr0 td{
cursor:pointer;
}
#tr1 {
background-color:#ccc;
}
#tr1 td {
font-weight:bold;
}
.blue{
background-color:#88f;
}
.white {
background-color:#fff;
}
.grey {
background-color:#ccc;
}
</style>
<script type="text/javascript">
function init(){
var tds=document.getElementById('mytable').rows[0].cells;
for(var c=0;c<tds.length;c++) {
tds[c].number=c;
tds[c].onmouseover=function() {
var n=this.number;
if(n!=0) {
this.className='blue';
document.getElementById('cell-'+n).className='white';
this.onmouseout=function(){
this.className='white';
document.getElementById('cell-'+n).className='grey';
}
}
}
}
}
window.addEventListener?
window.addEventListener('load',init,false):
window.attachEvent('onload',init);
</script>
</head>
<body>
<table id="mytable">
<tr id="tr0">
<td>UK</td>
<td>8</td><td>9</td><td>10</td>
<td>11</td><td>12</td><td>13</td>
</tr>
<tr id="tr1">
<td>EURO</td>
<!--change these id numbers round to suit your requirements -->
<td id="cell-6">42</td><td id="cell-3">43</td><td id="cell-5">44</td>
<td id="cell-1">45</td><td id="cell-4">46</td><td id="cell-2">47</td>
</tr>
</table>
</body>
</html>
No problem, you're very welcome. ;)
var tds=document.getElementById('mytable').rows[0].cells;
var tds=document.getElementById('mytable').rows[1].cells;