tables and href

I want to ancor several lines in a table.
This works with <a href=#ancor>  on the same document, but not with <a href=file#ancor> from/to another document, wher it alwas jumps to the beginning of the table.
Any hints?
LVL 51
ahoffmannAsked:
Who is Participating?
 
linda101698Connect With a Mentor Commented:
ahoffmann asks that I post the following answer to this question.

Linda Gardner
Customer Service @ Experts Exchange


    Ancors in a table *must* be inside the <TD> or <TH> tags to work properly.
    Example:

    <A HREF="#table_ancor">good</A>
    <A HREF="#bad_ancor"  >bad</A>
    <TABLE> ...
    <TD><A NAME=table_ancor>data</TD>
    <A NAME=bad_ancor><TD>next data</TD>
     ...
    </TABLE>


0
 
Christian_WenzCommented:
do you have an online example?
0
 
ahoffmannAuthor Commented:
no
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
DavidMECommented:
Does it happen with several different browsers?

Have you checked that the name of the anchor is exactly the same?
0
 
ahoffmannAuthor Commented:
happens with IE4.0, Netscape 3.x and 4.05
0
 
rupertsCommented:
I tried this as well, and it can't be done, it will always jump to the begining of the table...

Unless you can split your table into 2 smaller tables and put the anchor in between.
0
 
ahoffmannAuthor Commented:
ruperts, I won't believe (for now).
0
 
MasseyMCommented:
works fine for me in IE 4.x.. Can you post your code or email it to me at masseym@javanet.com

- Matt
0
 
ahoffmannAuthor Commented:
while preparing an example, I found the solution:
 the problem where not the HREF tags, but the NAME tags.
(for the points) does anybody know what was wrong (the syntax was ok)?
0
 
MasseyMCommented:
If you have spaces after the # char it will not work.
0
 
DavidMECommented:
Does it work if you use quotes: <A NAME="thename">?
0
 
jrsjrCommented:
My guess is that it could not find the anchor because the anchor had a # sign and should not have.  Therefore, it just jumped to the page and didn't actually jump to any anchor.  When you edited the anchor syntax, it was then able to jump to the anchor instead of just jumping to the page.

What did you change?
0
 
MasseyMCommented:
the answer above:  You have to have the # to decare it as an anchor.

0
 
ahoffmannAuthor Commented:
I'm going to support@experts-exchange to answer my own question ;-)

0
 
jrsjrCommented:
In my answer, I meant that the actual anchor name may have had a # in it.  It doesn't need to and should not.  A proper example would be:
<a name="anchor1">
and use
<a href="#anchor1">

It sounds like the external link couldn't find the anchor and therefore went to the top.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.