Home > DeveloperSection > Forums > how to make a whole row in a table clickable as a link?
Mark Devid
Mark Devid

Total Post:101

Points:707
Posted on    September-25-2013 7:49 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 3016  View(s)
Rate this:

Is it possible to make a whole row clickable as a link? I'm using bootstrap andthe following doesn't work:

<tbody>

    <a href="#">

        <tr>

            <td>Blah Blah</td>

            <td>1234567</td>

            <td>£158,000</td>

        </tr>

    </a>

</tbody>



Pravesh Singh

Total Post:411

Points:2881
Posted on    September-25-2013 9:56 AM

Hi Mark,

You could include an anchor inside every <td>, like so:

<tr>

  <td><a href="#">Blah Blah</a></td>

  <td><a href="#">1234567</a></td>

  <td><a href="#">more text</a></td>

</tr>

You could then use display:block; on the anchors to make the full row clickable.

tr:hover {

   background: red;

}

td a {

   display: block;

   border: 1px solid black;

   padding: 16px;

}


Don't want to miss updates? Please click the below button!

Follow MindStick