How can entire table cell be hyperlinked in html without javascript or jquery?
I tried to put href in td tag itself but its not working at least in chrome 18
<td href='http://www.m-w.com/dictionary/' style="cursor:pointer">
Yes in spite of text we just have to insert the anchor tag between the and tags.
Using <a> tag inside <td> One more way to make the whole row clickable is to add an <a> inside every <td> element. Along with it add hover to the row which we want to make clickable and use display: block property to anchor to make the whole row clickable.
Allowing a table row to be a link is not as simple as one might think. This article explains what the main issue is with making links out of table rows, provides some solutions to the problem, showcase some real-world examples, and question whether having a table row as a link is something that should even be done.
Try this:
HTML:
<table width="200" border="1" class="table"> <tr> <td><a href="#"> </a></td> <td> </td> <td> </td> </tr> </table>
CSS:
.table a { display:block; text-decoration:none; }
I hope it will work fine.
Try this way:
<td><a href="..." style="display:block;"> </a></td>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With