Sorting in TablePress - ucsf-ckm/ucsf-library-ux-and-web-documentation GitHub Wiki

TablePress is a free and open source plugin for the WordPress publishing platform. Your tables can contain any type of data, like numbers, text, images, links, and even math formulas! In addition, features like live sorting, pagination, searching, and more can be enabled for your site’s visitors.

The tables are created and edited within Dashboard > TablePress. The shortcode [table id=N /] is used to display a table in a post, on a page, or in a text-widget.

Setting the default sort view

from the developer:

  1. You could just sort the table on the “Edit” screen as you enter the rows and that will be the default display
  2. Another way to set the default is to add this to the “Custom Commands” text field on the table’s “Edit” screen to have the DataTables JS library start an initial sort, when the page is loaded:

"order": [ 0, 'asc' ](/ucsf-ckm/ucsf-library-ux-and-web-documentation/wiki/-0,-'asc'-)

tablepress interface

This will sort the table for the first column (counting the columns in this code starts with 0) and display in ascending order.