search

Home  >  Q&A  >  body text

How to make table cells into hyperlinks

<p>How to set an entire table cell as a hyperlink without using JavaScript or jQuery? </p> <p>I tried putting the href in the td tag itself, but that didn't work, at least in Chrome 18. </p> <pre class="brush:php;toolbar:false;"><td href='http://www.m-w.com/dictionary/' style="cursor:pointer"></pre> </p>
P粉129731808P粉129731808488 days ago534

reply all(2)I'll reply

  • P粉501007768

    P粉5010077682023-08-24 20:56:21

    Try this way:

    <td><a href="..." style="display:block;">&nbsp;</a></td>

    reply
    0
  • P粉733166744

    P粉7331667442023-08-24 10:44:39

    Try this:

    HTML:

    <table width="200" border="1" class="table">
        <tr>
            <td><a href="#">&nbsp;</a></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </table>

    CSS:

    .table a
    {
        display:block;
        text-decoration:none;
    }

    Hope it works properly.

    reply
    0
  • Cancelreply