anchor "names" in empty table cells

Discussion in 'HTML' started by James Mercola, Aug 9, 2004.

  1. Hi...\

    one inconsistency I've noticed, is that when placing "named anchors" ( <a
    name="anchorname"> ) on a page for people to navigate very quickly on long
    pages, that depending on where I place the tag, it may not work.

    example: i placed a tag in an empty table cell. it didn't work. I added a
    non-breaking space to the table cell. It worked.

    is there any guide anywhere as to where to, and where not to, place anchor
    tags?

    (using IE6 BTW)

    thanks for any pointers...

    JM
     
    James Mercola, Aug 9, 2004
    #1
    1. Advertising

  2. James Mercola

    Sam Hughes Guest

    "James Mercola" <> wrote in
    news:pCSRc.74897$T_6.25226@edtnps89:

    > Hi...\


    Hello - -\/kkj:-0-

    > one inconsistency I've noticed, is that when placing "named anchors"
    > ( <a name="anchorname"> ) on a page for people to navigate very
    > quickly on long pages, that depending on where I place the tag, it may
    > not work.


    I'll assume you included a closing tag of </a>.

    And surely, you meant to type <a name="anchorman">, no? Alas, never
    mind.

    > example: i placed a tag in an empty table cell. it didn't work. I
    > added a non-breaking space to the table cell. It worked.
    >
    > is there any guide anywhere as to where to, and where not to, place
    > anchor tags?


    It's always good (and logical) to have some text within the anchor. Then
    you cannot go wrong.

    I.e. <a name="anchorname">blithering happiness</a>

    > (using IE6 BTW)


    Well I'm not.

    --
    In a room with thirty-seven people, never have everybody shake each
    other's hand.
     
    Sam Hughes, Aug 9, 2004
    #2
    1. Advertising

  3. Well, hey Sam, "37 Helen's Can't Be Wrong!"

    yes,the closing <a> is not an issue.
    no, i don't want hyperlinked text as part of the anchor. the anchor is
    simply a "destination" that people get to on a long page. Say you have
    referenced footnotes at the bottom of a long article. And a link at the top
    for "references"

    <a href="#references">

    Then, down almost at the point where the footnotes start, I place the
    "destination" anchor tag

    <a name="references"></a>

    I've just noticed that browsers (at least ie6) is finnicky and won't use
    these links if the "destination" anchor is placed - for instance - in an
    empty table cell.

    Hopefully this clarifies the situation somewhat.

    JM



    > It's always good (and logical) to have some text within the anchor. Then
    > you cannot go wrong.
    >
    > I.e. <a name="anchorname">blithering happiness</a>
    >
    > > (using IE6 BTW)

    >
    > Well I'm not.
    >
    > --
    > In a room with thirty-seven people, never have everybody shake each
    > other's hand.
     
    James Mercola, Aug 10, 2004
    #3
  4. James Mercola

    Mark Parnell Guest

    On Mon, 09 Aug 2004 22:09:51 GMT, James Mercola <>
    declared in alt.html:

    > Hi...\


    G'day.

    > one inconsistency I've noticed, is that when placing "named anchors" ( <a
    > name="anchorname"> ) on a page for people to navigate very quickly on long
    > pages, that depending on where I place the tag, it may not work.


    Sounds like a bug in the browser. URL?

    > example: i placed a tag in an empty table cell.


    Doesn't sound like tabular data to me.
    http://www.allmyfaqs.com/faq.pl?Tableless_layouts

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    "Never drink rum&coke whilst reading usenet" - rf 2004
     
    Mark Parnell, Aug 10, 2004
    #4
  5. "James Mercola" <> wrote:

    > no, i don't want hyperlinked text as part of the anchor. the
    > anchor is simply a "destination" that people get to on a long
    > page.


    Then why not settle for the id-attribute? Just give the cell, text,
    image or whatever in question the relevant id:

    <a href="#foo">Go to foo</a>
    ....
    <h1 id="foo">This is the header for foo</h1>

    Of course this won't work in Netscape 4.x, but who cares about that
    virtual fossil anyway?

    --
    Anders Thorsen Holm | http://www.thorsenholm.dk
    "Angry men in combat fatigues talkin' to God on a two-way radio and
    muttering incoherent slogans about freedom are eventually gonna provide
    us with a great deal of entertainment." -- George Carlin
     
    Anders Thorsen Holm, Aug 10, 2004
    #5
  6. James Mercola

    Sam Hughes Guest

    "James Mercola" <> wrote in
    news:17URc.74918$T_6.12858@edtnps89:

    By the way, this newsgroup's convention is bottom posting.
    Resistance is futile. Prepare to be assimilated.

    > Well, hey Sam, "37 Helen's Can't Be Wrong!"


    What are you typing about?

    > yes,the closing <a> is not an issue.
    > no, i don't want hyperlinked text as part of the anchor.


    Why not. You're being dogmatic. The HTML 4.01 Specification makes a
    small word of warning about browser behavior:

    Note. User agents should be able to find anchors created by empty A
    elements, but some fail to do so. For example, some user agents may
    not find the "empty-anchor" in the following HTML fragment:

    <A name="empty-anchor"></A>
    <EM>...some HTML...</EM>
    <A href="#empty-anchor">Link to empty anchor</A>

    I do not think IE has this problem, but it is one good reason to include
    text within named anchors.

    > the anchor
    > is simply a "destination" that people get to on a long page.


    Yes. For instance, if I have <h2><a name="blegh">His Bleghiness</a>
    </h2>, then the destination is the text of the level-two heading, "His
    Bleghiness." You seem to view "destination" as meaning a specific pixel.

    > [snip superfluity]





    --
    In a room with thirty-seven people, never have everybody shake each
    other's hand.
     
    Sam Hughes, Aug 10, 2004
    #6
  7. James Mercola

    Sam Hughes Guest

    Anders Thorsen Holm <> wrote in
    news:Xns95411EC53EBD6thorsenholm@194.255.237.194:

    > <a href="#foo">Go to foo</a>
    > ...
    > <h1 id="foo">This is the header for foo</h1>
    >
    > Of course this won't work in Netscape 4.x, but who cares about that
    > virtual fossil anyway?


    Why deliberately introduce a solution that unnecessarily breaks older
    browsers when a simple, ubiquitous alternative is available?


    --
    In a room with thirty-seven people, never have everybody shake each other's
    hand.
     
    Sam Hughes, Aug 10, 2004
    #7

  8. > Of course this won't work in Netscape 4.x, but who cares about that
    > virtual fossil anyway?
    >


    Anders, I'm in total agreement with you. Let them eat cake. I'm a bit of a
    rebel at heart, but I will take Sam's advice and post at the bottom of the
    topic, just so I don't ruin his rum & coke.

    By the way Sam, to get the "37 Helens" thing, (1) you have to be Canadian,
    and (2) you have to be familiar with "The Kids In The Hall". It's kind of a
    private serendipitous pun for Canucks who might be lurking amongst the
    bullrushes.

    Aside from that, whatever raises the fur on your browser is agreeable to me.

    JM
     
    James Mercola, Aug 10, 2004
    #8
    1. Advertising

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. Karsten Wutzke
    Replies:
    9
    Views:
    7,382
    Scott Yanoff
    Oct 31, 2003
  2. Jeff Thies

    "opening" empty table cells

    Jeff Thies, Jun 25, 2004, in forum: HTML
    Replies:
    2
    Views:
    433
    Whitecrest
    Jun 25, 2004
  3. Luigi Donatello Asero

    Table with empty cells

    Luigi Donatello Asero, Sep 3, 2004, in forum: HTML
    Replies:
    2
    Views:
    463
    Dan Boyd
    Sep 4, 2004
  4. Luigi Donatello Asero

    Re: Table with empty cells

    Luigi Donatello Asero, Sep 4, 2004, in forum: HTML
    Replies:
    0
    Views:
    417
    Luigi Donatello Asero
    Sep 4, 2004
  5. Savvoulidis Iordanis

    Empty gridview cells and checking for empty string

    Savvoulidis Iordanis, Sep 5, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    531
    Savvoulidis Iordanis
    Sep 5, 2008
Loading...

Share This Page