做个参考吧
<script language=javascript>
function check(num)
{
var num=num;
var dd=document.getElementsByTagName("div").length;
for(var i=1;i<=dd;i++)
{
if(num==i)
{
document.getElementById("d"+num).style.display="block";
document.getElementById("t"+num).style.backgroundColor="#ECECEC";
}
else
{
document.getElementById("d"+i).style.display="none";
document.getElementById("t"+i).style.backgroundColor="#FFFFFF";
}
}
}
</script>
<table border=0 cellspacing=1 cellpadding=0 width=500 bgcolor="#ECECEC">
<tr bgcolor="#FFFFFF" height=30>
<td width=25% align=center id=t1 bgcolor="#ECECEC">
<a href="javascript:check(1);">A</a></td>
<td align=center id=t2><a href="javascript:check(2);">B</a></td>
<td align=center id=t3><a href="javascript:check(3);">C</a></td>
<td align=center id=t4><a href="javascript:check(4);">D</a></td>
</tr>
<tr bgcolor="#FFFFFF" height=30><td colspan="4">
<div id=d1 style="display:block">A1 A2</div>
<div id=d2 style="display:none">B1 B2</div>
<div id=d3 style="display:none">C1 C2</div>
<div id=d4 style="display:none">D1 D2</div>
</td></tr>
</table>