santa santa - 24 days ago 6x
CSS Question

Link entire table row?

I know it is possible to link an entire table cell with CSS.

.tableClass td a{
display: block;

Is there a way to apply a link to an entire table row?


I agree with Matti. Would be easy to do with some simple javascript. A quick jquery example would be something like this:

  <td><a href="">example</a></td>
  <td>another cell</td>
  <td>one more</td>


$('tr').click( function() {
    window.location = $(this).find('a').attr('href');
}).hover( function() {

then in your CSS

tr.hover {
   cursor: pointer;
   /* whatever other hover styles you want */