santa santa - 1 year ago 86
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?

Answer Source

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 */
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download