• Resolved Muhammad shafiq

    (@muhammadshafiq)


    Hello! I am in love with your amazing plugin. I need help.
    Let’s suppose I have a table that consists of 100 rows. I want to link row 10, row 50, and row 80 of this table from another page. Is this possible?

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, you would have to add an HTML link target to these rows, by adding something like this to each row:

    <span id="table-row-10" />
    

    and so on.
    Then, on the other page, you could create a link to the page with the table, where you append that ID value:

    <a href="https://example.com/page-with-table/#table-row-10">Link to row 10</a>
    

    Note how that ID value from the <span> appears in the URL.

    This way, you’ll have a link directly to that row. However, note that this will not work for most rows in a table that uses the pagination feature.

    Regards,
    Tobias

    Thread Starter Muhammad shafiq

    (@muhammadshafiq)

    Thanks, @tobiasbg . One more question. I want to have more than one header in a single table. Is it possible. I have a table of about 900 rows, and I want 20 headers in this table.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no, sorry, having more than one header is not possible. The only option would be to change the styling of some rows so that they look like a header, e.g. via https://tablepress.org/faq/change-background-color-of-a-row/

    Regards,
    Tobias

    Thread Starter Muhammad shafiq

    (@muhammadshafiq)

    Thanks again @tobiasbg

    .tablepress-id-N .row-X to {
    background-color: #ff0000;
    color: #00ff00;
    }

    but I have multiple rows in a single table and I won’t use a single CSS code multiple times. In the above CSS code can I separate the rows number with commas so that the changes apply to all the rows with a single code? Or is there any other easy way?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you can write it like

    .tablepress-id-123 .row-3 td,
    .tablepress-id-123 .row-7 td,
    .tablepress-id-123 .row-11 td {
      background-color: #ff0000;
      color: #00ff00;
    }

    Regards,
    Tobias

    Thread Starter Muhammad shafiq

    (@muhammadshafiq)

    Thanks @tobiasbg . The code is almost the same. Actually, I have more than 20 tables like this and each table has 15-20 headings. If I use the above code for each table my site will just full of CSS codes. I wish there were a way to edit rows through the advance editor of the plugin. Now I will try to split the single table into multiple tables.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    you could also use the TablePress Row Highlight Extension approach, see https://www.ads-software.com/support/topic/highlight-a-row-based-on-value/ for more.
    You would have to add a new column to the table, with a keyword like “header” that you then use in the Extension. That new column could be hidden with CSS then.
    This way, your CSS would be much shorter, and you wouldn’t have to update it when inserting new rows into a table.

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Can i link to specific rows in tablepress from another page’ is closed to new replies.