SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Temecula, CA
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hyperlink a row?

    Anyone know how to hyperlink a row? I want the whole row to be linked:
    Code:
    <a href='WebStatsYearsAndPeriods.php'>
     <tr>
      <td>$Year</td>
      <td>$Period</td>
     </tr>
     </a>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,044
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)

    row link

    Maybe
    HTML Code:
     <tr>
      <td><a href='WebStatsYearsAndPeriods.php'>$Year</a></td>
      <td><a href='WebStatsYearsAndPeriods.php'>$Period</a></td>
     </tr>

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Temecula, CA
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Surely that does produce a similar effect, but without a bunch of Javascript, it doesn't produce the a:link, a:hover, a:visited effect. Instead it gives the impression that there are two individual links per row, whereas the idea is for there to be one link for the entire row.

    It's a puzzlement! I just don't get why it doesn't work.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,044
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)

    row link

    It must be something to do with block level elements as opposed to inline elements and what can be inside what. Have you tried
    HTML Code:
    <tr>
    <a href='WebStatsYearsAndPeriods.php'>
      <td>$Year</td>
      <td>$Period</td>
    </a>
     </tr>

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Temecula, CA
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just tried it. Same results -- nothing.

    I think you're right; it's got something to do with the block level status of the elements in question. I should stop wondering about it and read up on the subject. Wouldn't be surprised to find the W3C docs saying "you can't hyperlink a row!"

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,044
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)

    bock - inline

    It seems that table, tr, and td are block level elements (I don't see why td would be, but .... ) and a is an inline element. Inline elements can only have other inline elements in them, so table, tr, and td are out. http://www.ahuka.com/htmllevel1/blocklevel.html


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
  •