• Resolved DarkCoder

    (@darkcod3r)


    Hi. Can someone help me regarding anchor text to specific heading/Text. For example i created a table , added text lets say “xyz” in a cell, now what i want is when someone click on that “xyz” text it go to that specific text on same page (like if i set heading “xyz” on same page, when click on “xyz” in table , it goes to that heading). How i do that. i am unable to find instructions in documentation or YouTube video of this specific problem. Thank You.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Essentially, you’ll need this approach: https://www.ads-software.com/support/topic/linking-between-tables-using-an-anchor/

    The headings on the other page first need to get an anchor. If you can edit their HTML code, you would add a unique ID:

    <h2 id="my-heading">My Heading</h2>
    

    If you are using the WordPress block editor, you can specify that ID in the block settings.

    Then, the HTML code the link in the TablePress table would need to look like this:

    <a href="/your-page/#my-heading">Go to My Heading</a>
    

    That is, the ID from above is appended to the link URL after an extra #.

    Regards,
    Tobias

    Thread Starter DarkCoder

    (@darkcod3r)

    Thank You For Answering. One more thing

    .tablepress-id-3 .column-4 td {
    	font-weight: bold;
    	color: #FF0000;
    }

    this code suppose to change column 4 text colour to red and make it bold, but when i apply this code it wont work. why?! Check Screenshot .

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    the .column-4 CSS class is actually applied to the td element, so that the latter is not a “child element” here. (This is only the case for the row syntax.)
    Thus, please try with

    .tablepress-id-3 .column-4 {
    	font-weight: bold;
    	color: #FF0000;
    }

    Regards,
    Tobias

    Thread Starter DarkCoder

    (@darkcod3r)

    Great, Worked. And is it possible that these css styles get applied by itself for all tables.?! for example i want this below code to apply all future and previous tables (so i dont have to define CSS every time for each table).

    .tablepress-id-3 .column-4 {
    	font-weight: bold;
    	color: #FF0000;
    }

    Thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    to have this applied to all tables, just use

    .tablepress .column-4 {
    	font-weight: bold;
    	color: #FF0000;
    }

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    to have this applied to all tables, just use

    .tablepress .column-4 {
    	font-weight: bold;
    	color: #FF0000;
    }

    Regards,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to Add Anchor Text in a Cell.?’ is closed to new replies.