Title: Can&#8217;t sort table
Last modified: May 30, 2018

---

# Can’t sort table

 *  Resolved [Boldt](https://wordpress.org/support/users/enso/)
 * (@enso)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/cant-sort-table/)
 * I installed the DataTables Sorting plugin but I can’t sort the tables I enabled
   sorting on. It happens with every browser I tried.
 * The demo table on the TablePress sorts properly.
 * I checked the documentation and I didn’t find anything that would cause it. I
   changed to TwentySeventeen theme and disabled the only other plugin (Gutenberg)
   that I have installed without any effect. The WordPress version of jQuery is 
   being loaded.
 * I’m using the latest versions of WordPress, TablePress, and DataTables Sorting.
 * Table Head Row is checked.
 * The “sorting” class is not applied to the <th> tags. I did change the priority
   of my style.css to load after TablePress css, but undoing that didn’t make any
   difference.
 * There’s no output from WP_DEBUG.
 * The only thing I see is a JS error in jquery.datatables.min.js in function GA:
 *  TypeError: i is undefined
 * The statement is:
 *  i._DT_CellIndex = {row: b, column: l};
 * But this is present whether or not DataTables Sorting is enabled.
 * Could developing using localhost be causing it?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcant-sort-table%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/cant-sort-table/#post-10344183)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Does your table maybe have `#colspan#` or `#rowspan#` in it? Those are not compatible
   to the DataTables JS library, which requires that all rows have the same number
   of cells.
 * If that’s not it, there’s most likely a cell in your table that contains invalid
   HTML. In particular, there will be a `"` missing somewhere.
 * Regards,
    Tobias
 *  Thread Starter [Boldt](https://wordpress.org/support/users/enso/)
 * (@enso)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/cant-sort-table/#post-10344495)
 * Tobias,
 * Thanks for the quick reply. Yes, the table has a #colspan#. I didn’t think about
   that as a possible explanation.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/cant-sort-table/#post-10344521)
 * 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 3 replies - 1 through 3 (of 3 total)

The topic ‘Can’t sort table’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/cant-sort-table/#post-10344521)
 * Status: resolved