Title: doesn&#8217;t work with table block?
Last modified: December 4, 2024

---

# doesn’t work with table block?

 *  [James Monroe](https://wordpress.org/support/users/jhmonroe/)
 * (@jhmonroe)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/doesnt-work-with-table-block/)
 * Hey! This plugin is such a simple solution for table sorting!
 * However, it doesn’t seem to work with the TABLE BLOCK generated by the new standard
   WordPress block editor (aka Gutenberg)?
 * The reason being… the TABLE BLOCK inserts a <figure> which has <table> nested
   inside it.
 * Example:
 *     ```wp-block-code
       <figure class="wp-block-table tablesorter"><table class="has-fixed-layout"><thead><tr><th>head</th><th>head2</th></tr></thead><tbody><tr><td>alpha</td><td>bet</td></tr><tr><td>bet</td><td>alpha</td></tr></tbody></table></figure>
       ```
   
 * So when the user tries to add “tablesorter” class to the Advanced sidebar for
   the block, the block editor interface adds this class to the FIGURE and not the
   TABLE.
 * I tried adding this class manually via the Code Editor and it broke the block.
 * Any simple way to get this plugin working with the block editor as well? Perhaps
   your PHP could also look for Figure > Table and achieve the same outcome?
 * Thank you!
 * Screenshot: [https://www.dropbox.com/scl/fi/bzgiha3gk7yme55pzklvb/Screen-Shot-2024-12-04-at-9.47.59-AM.png?rlkey=pud16q12ggnzueg9es4edqxlg&dl=0](https://www.dropbox.com/scl/fi/bzgiha3gk7yme55pzklvb/Screen-Shot-2024-12-04-at-9.47.59-AM.png?rlkey=pud16q12ggnzueg9es4edqxlg&dl=0)
 * —
 * **UPDATE:** I changed some CSS & elements in your plugin and it seems to work.
   Any way you can confirm and incorporate this as an alternate?
 * IN CSS: Changed all references to table.tablesorter to figure.tablesorter>table
 * IN jquery.tableshorter.js: Change all references at top to (‘figure>table’).tablesorter()
 * Then the only catch is that there is no way to add “sortless” to TH since adding
   it in the block code editor also breaks the block 🙁
    -  This topic was modified 1 year, 6 months ago by [James Monroe](https://wordpress.org/support/users/jhmonroe/).
    -  This topic was modified 1 year, 6 months ago by [James Monroe](https://wordpress.org/support/users/jhmonroe/).
    -  This topic was modified 1 year, 6 months ago by [James Monroe](https://wordpress.org/support/users/jhmonroe/).
    -  This topic was modified 1 year, 6 months ago by [James Monroe](https://wordpress.org/support/users/jhmonroe/).

The topic ‘doesn’t work with table block?’ is closed to new replies.

 * ![](https://ps.w.org/table-sorter/assets/icon-256x256.jpg?rev=1447744)
 * [Table Sorter](https://wordpress.org/plugins/table-sorter/)
 * [Support Threads](https://wordpress.org/support/plugin/table-sorter/)
 * [Active Topics](https://wordpress.org/support/plugin/table-sorter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/table-sorter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/table-sorter/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [James Monroe](https://wordpress.org/support/users/jhmonroe/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/doesnt-work-with-table-block/)
 * Status: not resolved