Title: Sorting dont work correct
Last modified: May 28, 2020

---

# Sorting dont work correct

 *  Resolved [bazilio07](https://wordpress.org/support/users/bazilio07/)
 * (@bazilio07)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/)
 * Hi, Tobias. Please help, dear. Why sorting dont work good?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsorting-dont-work-correct%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12905985)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * The problem here is that your table cells contain HTML code, and not just pure
   numbers.
    Can you maybe change that? That would be the easiest.
 * If not, please try adding this to the “Custom Commands” text field on the table’s“
   Edit” screen:
 *     ```
       "columnDefs": [ { "type": "html-num", "targets": [ 1, 2 ] } ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [bazilio07](https://wordpress.org/support/users/bazilio07/)
 * (@bazilio07)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12906033)
 * Yes, i can change, but i cant find html code in table cells.
    Сould you tell 
   me in which cells this html code?
 *  [fantasyfuru](https://wordpress.org/support/users/fantasyfuru/)
 * (@fantasyfuru)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12906088)
 * Hi Tobias,
 * I have a question in regards to sorting as well. It’s probably an easy fix but
   I’m still in the process of familiarizing myself with the plugin. Initially when
   I tried to sort by “Pos. Rank” on this page it would come up like:
 * QB 1
    QB 10 QB 11 etc.
 * Then I tried adding in the custom command “”columnDefs”: [ { “type”: “formatted-
   num”, “targets”: [ 2, 3 ] } ]
    for column 3 and I would get this:
 * RB 1
    WR 1 TE 1 QB 1 RB 2 WR 2 etc.
 * I’m hoping to find a way to have it sort like:
    QB 1 QB 2 QB 3 etc. then progress
   to the next position RB 1 RB 2 etc.
 * Any ideas on what I need to do
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12906097)
 * Hi,
 * [@bazilio07](https://wordpress.org/support/users/bazilio07/): What do you have
   in the table cells then? Maybe Shortcodes?
 * [@fantasyfuru](https://wordpress.org/support/users/fantasyfuru/): You will need
   a custom sorting algorithm, or maybe the approach from [https://wordpress.org/support/topic/sorting-months-in-a-smart-way/](https://wordpress.org/support/topic/sorting-months-in-a-smart-way/)
 * Regards,
    Tobias
 *  Thread Starter [bazilio07](https://wordpress.org/support/users/bazilio07/)
 * (@bazilio07)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12906169)
 * yes shortcodes
 *  Thread Starter [bazilio07](https://wordpress.org/support/users/bazilio07/)
 * (@bazilio07)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12906186)
 * ok, thanks, Tobias
 *  [fantasyfuru](https://wordpress.org/support/users/fantasyfuru/)
 * (@fantasyfuru)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12906248)
 * Thanks!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12907090)
 * 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](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Sorting dont work correct’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/sorting-dont-work-correct/#post-12907090)
 * Status: resolved