You mean like this?
--------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html
<html>
<head>
<title>Q_22017271</title>
</head>
<body>
<table border='1'>
<tr>
<th>
Title
</th>
<th>
Empty
</th>
</tr>
<tr>
<td colspan='2' onclick='alert("Hi");'>
</td>
</tr>
</table>
</body>
</html>
Main Topics
Browse All Topics





by: sajuksPosted on 2006-10-08 at 20:01:51ID: 17688471
We had a similar requirement and used the method outlined at http://radio.javaranch.com /pascarell o/2005/05/ 19/ 1116509 823591.htm l ");
d){
ableId).ge tElementsB yTagName(" tr");
{ me("a") n.href='" + link[0].href + "'"); highlight' "); '");
.com">Java Ranch</a>< /td> ASP.NET</a ></td> ch.com/Pas carello">E ric's Blog</a></td>
//the code
<html>
<head>
<style type="text/css">
table{
border: 1px solid black;
border-collapse: collapse;
width: 50%;
}
th, td{
border: 1px solid black;
padding: 3px;
width: 25%;
}
th{
background-color: #A0A0A0;
}
tr{
background-color: white;
}
tr.highlight{
background-color: #B8CDDC;
cursor: pointer;
}
</style>
<script type="text/javascript">
window.onload = function(){
ConvertRowsToLinks("table1
}
function ConvertRowsToLinks(xTableI
var rows = document.getElementById(xT
for(i=0;i<rows.length;i++)
var link = rows[i].getElementsByTagNa
if(link.length == 1){
rows[i].onclick = new Function("document.locatio
rows[i].onmouseover = new Function("this.className='
rows[i].onmouseout = new Function("this.className='
}
}
}
</script>
</head>
<body>
<table id="table1">
<tr>
<th>Website</th>
<th>Subject</th>
<th>Content</th>
</tr>
<tr>
<td><a href="http://www.JavaRanch
<td>Java</td>
<td>Content and Forums</td>
</tr>
<tr>
<td><a href="http://www.asp.net">
<td>.NET</td>
<td>Content and Forums</td>
</tr>
<tr>
<td><a href="http://radio.javaran
<td>JavaScript,.NET,and Stuff</td>
<td>Programming Discussion</td>
</tr>
</table>
</body>
</html>