• Resolved stubsal

    (@stubsal)


    Hello,

    I’m struggling with anchors in TablePress and hope you can help me.

    I have 2 tables added to one page. I would like to place a link in on of the cells in the upper table (table 1) that links to a certain row in the lower table (table 2). In other words: If someone clicks on on the picture I placed in cell A1 of table 1 he should be re-directed to row 1 in table 2 (or cell A1 in table 2 respectively)

    I tried using the following:
    Cell A1 in table 1:
    <a href="#ABC"><img src="https://www.test.com/img/ABC.gif" width="114" height="114" /></a>
    Cell A1 in table 2:
    <a name="ABC"></a>ABC

    Unfortunately the above didn’t work. I suppose I need to add the fact that the anchor point is in a different table (2, not 1) to the code in A1 of table 1. However, I don’t know how.

    If anybody could help me out here, that would be great.
    If further information is needed, please just let me know.

    Thanks a lot already!

    • This topic was modified 7 years, 10 months ago by stubsal.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Your HTML code looks totally correct to me. And no, you do not have to specify that the link target is in a different table, as they will be on the same page in the end.

    Now, instead of
    <a name="ABC"></a>ABC
    please try
    <span id="ABC" />ABC
    which might work better.

    Regards,
    Tobias

    Thread Starter stubsal

    (@stubsal)

    Hi Tobias,

    thank you very much for this. It did the trick :o)

    Best regards
    Stefanie

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Anonymous User 14820382

    (@anonymized-14820382)

    I just found this question and answer when searching for how to set up anchors. It is exactly what I want to do, but when I put this code into my two tables, the link seems to jump down to two rows after where the anchor is placed.
    My code in table 1 is:
    Agility Ability of Greater Kansas City
    The code in table 2, cell A1 is:
    <span id=”AAGKC201109″ />Sept 9-11, 2011 – AKC – Agility Ability of Greater Kansas City
    The tables look okay, but the link it table 1 takes me to row 3 of table 2 instead of row 1.
    I tried changing table 2 to use “<a name=”, but it did the same thing.
    Is there something else I need to do?

    Anonymous User 14820382

    (@anonymized-14820382)

    It doesn’t look like the code that I entered above is showing up.

    Table 1: “Agility Ability of Greater Kansas City

    Table 2: “<span id=”AAGKC201109” />Sept 9-11, 2011 – AKC – Agility Ability of Greater Kansas City

    Will try this. Thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Anonymous User 14820382

    (@anonymized-14820382)

    Link: https://flyinblues.com/dev/results/results-2011/.
    In the first table, there are links to the second table. The anchor is placed in the second table on each of the highlighted rows. That’s were I would like to have the link jump to.

    Thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link! The jumping works pretty much fine for me. Just the first heading is hidden a little bit, as it disappears behind that blue frame around the page content.

    By default, those links will jump so that the target is directly at the top of the browser window. If there is not enough content until the end of the page is reached, the target might show up lower.
    All this is browser behavior, it can not be influenced with such HTML code.

    Regards,
    Tobias

    Anonymous User 14820382

    (@anonymized-14820382)

    Okay. Thanks so much for looking at it for me.
    Karen

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Karen,

    no problem, you are very welcome!

    Best wishes,
    Tobias

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Linking between tables using an anchor’ is closed to new replies.