• Resolved pop16

    (@pop16)


    Can i add any code to table press that sort empty text cells to the bottom?
    I sort from a to ö in one column (swedish language)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pop16

    (@pop16)

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi @pop16,

    Thanks for your question, I’ll be happy to help!

    For this, using an approach called “Absolute Sorting” is possible. Please find a custom mini-plugin (I call these “TablePress Extensions”) that makes absolute sorting available, here: https://cdn.tablepress.org/extensions/tablepress-datatables-absolute-sorting.zip

    Please download, install, and activate that just like any other plugin.

    Then, please extend the Shortcode (or “Configuration parameters” setting when using the block) on the page with a new parameter:

    [table id=11 datatables_absolute_sorting=true /]

    This will result in the relevant JavaScript file being loaded.

    In addition, we’ll need to assign that absolute sorting to the columns in question. For that, please add this to the “Custom Commands” text field on the table’s “Edit” screen:

    columnDefs: [
    { type: stringType, targets: [ 2, 4, 5 ] },
    ],

    This assigns a special sorting type to the columns with empty cells in your table (where counting the columns starts with 0 for the first column).

    I hope this helps! If anything is unclear, please let me know!

    Some additional remarks: It looks like your table is overflowing the theme to the right. This is especially visible on small screens, like phones. You could check out the Responsive Tables premium feature module for solution approaches to this.

    Best wishes,
    Tobias

    Thread Starter pop16

    (@pop16)

    Thank you very much it works great
    /Mats

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    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 in the plugin directory. Thanks!

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

You must be logged in to reply to this topic.