giva a <tr> a link

Discussion in 'HTML' started by Stijn Goris, Oct 4, 2004.

  1. Stijn Goris

    Stijn Goris Guest

    hi all,

    I do
    <table>
    <a href="..">
    <tr>
    <td>
    content
    </td>
    </tr>
    </a>
    </table>

    When I go over the content the arrow doesn't change from the usual arrow to
    the hand (normal when hovering above a link) but the edit cursor shows up (T
    with feet). Is use IE 6.0. It seems that IE doesn't work wel with tr that
    have a link. Can I make this work in IE and other browser in another way
    (maybee CSS)?

    Regards
    Srijn
     
    Stijn Goris, Oct 4, 2004
    #1
    1. Advertisements

  2. "Stijn Goris" <> writes:

    > hi all,
    >
    > I do
    > <table>
    > <a href="..">
    > <tr>
    > <td>
    > content
    > </td>
    > </tr>
    > </a>
    > </table>
    >
    > When I go over the content the arrow doesn't change from the usual arrow to
    > the hand (normal when hovering above a link) but the edit cursor shows up (T
    > with feet). Is use IE 6.0. It seems that IE doesn't work wel with tr that
    > have a link. Can I make this work in IE and other browser in another way
    > (maybee CSS)?


    Try this:

    <table>
    <tr>
    <td>
    <a href="..">
    content
    </a>
    </td>
    </tr>
    </table>

    You're making the mistake of trying to put a table row inside an anchor
    tag. It should be the other way round.

    Matt
     
    Matt N. Jones, Oct 4, 2004
    #2
    1. Advertisements

  3. On Mon, 4 Oct 2004 11:42:22 +0200, Stijn Goris <> wrote:

    [snip]

    > <table>
    > <a href="..">
    > <tr>
    > <td>
    > content
    > </td>
    > </tr>
    > </a>
    > </table>


    You cannot place a table row inside a link for two reasons:

    1) Links cannot be the child of any table-related element, other than a
    cell. That means that:

    <table>
    <a ...><tbody> or <a ...><tr>

    <tbody>
    <a ...><tr>

    <tr>
    <a ...><td>

    are all invalid. Only

    <td><a ...>

    is possible.

    2) Links can only contain inline elements - text, images, phrase elements
    (STRONG, CODE, etc), and the like. Table rows would be, if anything,
    block-level elements.

    I'm afraid you'll have to rethink your design, unless adding links with
    the same destination to all table cells in a row is acceptable. Even then
    you'll have problems if those cells contain block-level elements.

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Oct 4, 2004
    #3
  4. Stijn Goris

    yandr Guest

    "Stijn Goris" <> wrote in message
    news:41611aec$0$22098$...
    > hi all,
    >
    > I do
    > <table>
    > <a href="..">
    > <tr>
    > <td>
    > content
    > </td>
    > </tr>
    > </a>
    > </table>


    As others have posted, this is not valid HTML.

    However, if what you are trying to do is make the whole ROW of the table
    behave as a link, you will have to resort to CSS and even then you will
    only be able to turn a TD into a whole link.

    --

    Fleur de Coin
    - http://www.fleur-de-coin.com/
    Åëëçíéêüò óôñáôüò
    - http://skopia.digitalrice.com/
     
    yandr, Oct 4, 2004
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Graham Thomson
    Replies:
    3
    Views:
    648
    Eki Y. Baskoro
    Dec 18, 2003
  2. Dan M
    Replies:
    5
    Views:
    657
  3. kolesdz
    Replies:
    9
    Views:
    784
    Blinky the Shark
    Aug 22, 2007
  4. Marina Limeira

    LINK with another link

    Marina Limeira, Feb 7, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    256
    Marina Limeira
    Feb 7, 2006
  5. Andrew
    Replies:
    2
    Views:
    213
    Andrew
    Feb 18, 2009
  6. Blue®
    Replies:
    4
    Views:
    1,230
    Blue®
    Sep 27, 2003
  7. Carl Gilbert

    Link to run script and link to page

    Carl Gilbert, Jan 13, 2004, in forum: Javascript
    Replies:
    3
    Views:
    297
    Michael Winter
    Jan 13, 2004
  8. Jiong Feng
    Replies:
    1
    Views:
    321
    Lasse Reichstein Nielsen
    May 15, 2004
Loading...