Skip to main content
Inspiring
July 20, 2007
Question

HyperLick entire Row

  • July 20, 2007
  • 2 replies
  • 307 views
How do I hyperlink entire row with TDs
e.g
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
I need to create a an <a href> to wrap around the entire row so tha when user clicks any where within the row it is Hyperlinked
This topic has been closed for replies.

2 replies

Participating Frequently
July 21, 2007
I think Dan Bracuk's answer only works in IE.

Try using JavaScript and a bit of UI enhancement for rollover to indicate which row is going to be clicked on.

<style>
.hilite {background-color:#CCFFFF;}
.lowlite{background-color:#FFFFFF;}
</style>
<script>
function rowNav(url){
document.location.href= url;
}
</script>

then in the table row

<tr onMouseOver="this.className='hilite';" onMouseOut="this.className='lowlite';" onClick="rowNav('{put your url here}');">
.... td elements, etc.
</tr>

Reference: http://www.alistapart.com/articles/tableruler
Inspiring
July 20, 2007
Put your opening anchor tag before the opening table row tag and the closing anchor tag after the closing table row tag.