Results 1 to 2 of 2

Thread: Hyperlinking a table cell

  1. #1
    Join Date
    Jul 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hyperlinking a table cell

    Does anyone know the HTML code to link a whole table cell, rather than just the text or image in it?
    Thanks!

    Carolyn

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Support for that is spotty and unorthodox, I am referring to the obvious:
    Code:
    <a href="somepage.html"><td>whatever</td></a>
    That would be the only true way though. You probably could simulate the effect using padding for the link to make it the size of the cell or dimensions and/or padding for the image to do likewise. This worked real well for text links in a 3 celled <table width="450" height="200">:
    Code:
    <style type="text/css">
    table {
    border-collapse:collapse;
    border:1px solid lime;
    }
    td {
    border:1px solid lime;
    margin:0;
    padding:0;
    width:32.5%;
    height:100%;
    text-align:center;
    }
    a {
    height:100%;
    width:100%;
    padding:80px 20px;
    }
    </style>
    in IE and pretty well in FF (didn't get the entire width of each cell as a link but, close).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •