Support » Plugins and Hacks » TablePress » [Resolved] sorting multiple columns

[Resolved] sorting multiple columns

  • Hi
    Great plugin. We’re using it for a league of school rugby teams.
    However, there are two problems that I am trying to solve:

    1) Identifying the CSS code to sort by multiple columns e.g. sort by ‘total points’ column, followed by ‘points scored difference’ column. That way, two teams with the same total points will then be sorted according to their points scored difference.

    2) Adding code that will combine the totals of two cells e.g. column A – column B = column C

    Thanks so much for your help.



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



    thanks for your question, and sorry for the trouble.

    1) Sorting is not done with CSS, but with JavaScript (JS) code. The question here is: Which sorting are you refering to? That sorting that a user can do when he views the table? Or the sorting on the “Edit” screen of the table?

    2) For that, you can use math formulas in the table cells, see http://tablepress.org/tablepress-features-formulas/ for some examples.


    Thanks for the prompt reply Tobias.
    I would like to sort from the editing page. All sorting will be disabled for users.

    I shall follow the advice from your link. Thank you.

    Plugin Author TobiasBg



    thanks for the explanation! An automatic sorting on the “Edit” page for two columns is not possible at the moment, unfortunately.
    I can therefore only suggest to sort for the primary criterion (total points) there, and then manually use the drag and drop feature (via the row numbers on the left of each row) to switch those rows where the points difference requires it.
    An alternative would be to maintain the table in Excel, do the multi-column sorting there and then re-import the table into TablePress, choosing to replace the existing table.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] sorting multiple columns’ is closed to new replies.
Skip to toolbar