Title: Sorting function doesn&#8217;t work for some rows
Last modified: December 2, 2019

---

# Sorting function doesn’t work for some rows

 *  Resolved [qmolinie](https://wordpress.org/support/users/qmolinie/)
 * (@qmolinie)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/)
 * Hello !
    Thank you for your plugin 🙂 I use a table on this page : [https://www.darwin-nutrition.fr/super-aliments/spiruline/](https://www.darwin-nutrition.fr/super-aliments/spiruline/)
 * But some rows are not well sorted:
    – last column (%AR) sortering – rows “Vitamine
   A” and “Vitamine B1” are the biggest numbers, but are not on the top
 * Would you know why ?
 * I deleted then re-create the rows but it doesn’t change anything.
 * Thank you very much for your help !
    Quentin
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsorting-function-doesnt-work-for-some-rows%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12196176)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The cause for this is the mixed data type, with `,` and `%` in that column. This
   causes the JavaScript code to sort this as text and not numbers.
    Can you maybe
   write the numbers with a `.` instead of a `,`? That should be the quickest solution
   here.
 * Regards,
    Tobias
 *  [lafortuna](https://wordpress.org/support/users/lafortuna/)
 * (@lafortuna)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12196798)
 * Back-end sorting of the table columns stopped working for me, after I upgraded
   WordPress to version 5.3
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12197949)
 * Hi lafortuna,
 * first, please try to re-install WordPress and TablePress (to be sure that all
   files are correct). Sometimes, during the update not all files are written to
   the server’s disk properly.
 * If this still happens, please try again after temporarily deactivating all other
   plugins and after switching to a WordPress default theme like Twenty Twenty. 
   Maybe something else is interfering here.
 * Regards,
    Tobias
 * P.S.: Next time, please open a new thread for your problem, instead of just writing
   into an existing one, thanks 🙂
 *  [lafortuna](https://wordpress.org/support/users/lafortuna/)
 * (@lafortuna)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12204866)
 * Tobia,
 * you were right. The theme I am using, Imprint, does not function very well will
   WordPress 5.3.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12205886)
 * Hi,
 * thanks for checking on this!
 * Best wishes,
    Tobias
 *  Thread Starter [qmolinie](https://wordpress.org/support/users/qmolinie/)
 * (@qmolinie)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12245633)
 * Hello Tobias
 * Thank you for your answer
    I replaced the , by ., but it doesn’t solve the problem.
   There are no problems with sorting others columns (which have “,”), and for this
   last column it sorts well exception certains rows which are not well sorted in
   this column.
 * Thanks for your help
    Quentin
    -  This reply was modified 6 years, 5 months ago by [qmolinie](https://wordpress.org/support/users/qmolinie/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12245692)
 * Hi Quentin,
 * that’s weird… Maybe we need to force the correct data type then. Please add this
   to the “Custom Commands” text field on the “Edit” screen of the table:
 *     ```
       "columnDefs": [ { "type": "html", "targets": 4 } ]
       ```
   
 * (You might have to flush the cache of the Autoptimize plugin so that this is 
   properly applied.)
 * Regards,
    Tobias
 *  Thread Starter [qmolinie](https://wordpress.org/support/users/qmolinie/)
 * (@qmolinie)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12260285)
 * Thank you !
    Quentin
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12260625)
 * 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/)
   here in the plugin directory. Thanks!

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

The topic ‘Sorting function doesn’t work for some rows’ 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/)

 * 9 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/sorting-function-doesnt-work-for-some-rows/#post-12260625)
 * Status: resolved