Title: Sort Table with to Headers
Last modified: January 20, 2020

---

# Sort Table with to Headers

 *  Resolved [secc](https://wordpress.org/support/users/secc/)
 * (@secc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/)
 * Hi Tobias. I have a table with 2 different headers (german / french). Is it possible,
   to sort this tables? Currently it mixes the header lines and all the others. 
   It must be somethink like blocking the first to lines.
 * Thank you for your help.
    Manuel

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12345980)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Are you showing both header rows at the same time? Then, no, I’m not aware of
   keeping those fixed, sorry 🙁
 * But I thought that you would be hiding one of them, depending on the language?
   Or are you talking about the “Edit” screen here?
 * Regards,
    Tobias
 *  Thread Starter [secc](https://wordpress.org/support/users/secc/)
 * (@secc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12346959)
 * Hi Tobias
    Thank you for your feedback. Yes, im hidding one row depending on 
   the language. It would be nice, if i can sort the tables by name and dont have
   to move them manually into the right position on the backend.
 * Regards,
    Manuel
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12347820)
 * Hi,
 * thanks for the clarification. Unfortunately, I don’t really see a way to change
   the sorting on the “Edit” screen.
    The best solution here would probably be to
   simply use drag and drop (via the row number on the left) to again move the second
   header row up to the correct position.
 * Regards,
    Tobias
 *  Thread Starter [secc](https://wordpress.org/support/users/secc/)
 * (@secc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12348049)
 * Hi Tobias. Is there a way, to display it only sorted on the frontsceen? It doesnt
   have to sorted on the backend. Otherwise i will do it manually as you told before.
   Best regards. Manuel
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12348149)
 * Hi Manuel,
 * yes, that’s possible. You could initiate a JavaScript sort here, once the page
   loads.
    For that, please try adding this to the “Custom Commands” text field 
   on the table’s “Edit” screen:
 *     ```
       "order": [ [ 0, "asc" ] ]
       ```
   
 * That number indicates which column to sort on, in this case the first one, as
   counting the columns starts with 0. Besides using `"asc"` for ascending order,
   you can also use `"desc"` for descending order.
 * Regards,
    Tobias
 *  Thread Starter [secc](https://wordpress.org/support/users/secc/)
 * (@secc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12348489)
 * Hi Tobias
 * This works perfekt, also with the hidden row. Perfect. Thank you for your help.
   Best regards and a nice afternoon.
    Manuel
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/sort-table-with-to-headers/#post-12349587)
 * 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 7 replies - 1 through 7 (of 7 total)

The topic ‘Sort Table with to Headers’ 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/)

 * 7 replies
 * 2 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/sort-table-with-to-headers/#post-12349587)
 * Status: resolved