Support » Plugin: TablePress - Tables in WordPress made easy » Different Sorting Assignments (on different pages) for the Same Table

  • Resolved mjurglavitch

    (@mjurglavitch)


    Hello,

    I am using this plugin to keep track of statistics for a sports league. I currently have a table with a series of numbers in each column (i.e., Points, Assists, etc). I would like to be able to sort the same table of information in different ways on different pages. For example, the “Points” page would sort the “Points” column numerically. The “Assists” page would sort the “Assists” column numerically, and so on.

    Is there a way to do this using the shortcode without having to duplicate the table?

    Any and all help is appreciated. Thanks for your support and for making this phenomenal plugin.

    http://wordpress.org/extend/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your question.

    You might want to take a look at the “TablePress Table Row Order Extension” at http://tablepress.org/extensions/table-row-order/
    That extension will enable a new Shortcode parameter that can be used to show the table in different orders on different pages.

    Regards,
    Tobias

    Thread Starter mjurglavitch

    (@mjurglavitch)

    Tobias,

    Thanks for your prompt response. The filter works great for my sports website!

    I have another question. Here’s my issue: I have a table of sports statistics categories (i.e., Points, Assists, etc.) that are now organized into separate tables, that are filtered according to stat category. Is there a way to highlight, or change the color of the column or column header that is being filtered via shortcode? If not, what would you recommend doing to highlight the filtered content?

    Thanks again for your initial response. It is very much appreciated.

    Thread Starter mjurglavitch

    (@mjurglavitch)

    I wanted to clarfiy that I did add the "bSortClasses": true to the Custom Commands section of the table and add the `.tablepress tbody tr .sorting_1 {
    background-color: #ff0000;
    }` to the CSS.

    I would like for the column that is filtered, via the shortcode, to show up with that column already highlighted.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

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

    For the highlighting, I suggest this: Via the Shortcode, you can add an extra CSS class to the table, like this:

    [table id=123 row_order=... extra_css_classes="tablepress-stats-points" /]

    or

    [table id=123 row_order=... extra_css_classes="tablepress-stats-assists" /]

    So, for each sorting, you add a different CSS class. You can that use that in “Custom CSS” to style a certain column, e.g. with

    .tablepress-stats-points thead .column-3,
    .tablepress-stats-assists thead .column-4 {
      background-color: #ff0000;
    }

    This would change the color of the third column header cells of the table when it is sorted for Points, and that of the fourth when it it sorted for Assists.
    Due you get the idea?

    Regards,
    Tobias

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different Sorting Assignments (on different pages) for the Same Table’ is closed to new replies.