Back to Notenik.app


The Notenik Knowledge Base

10.2 Notenik Markdown Parser ↑

10.2.30 Make a Table Sortable

As an extension to the original Markdown spec from John Gruber, a Markdown Table may be made sortable by preceding it with the literal {:sort-table:xxx} on a line by itself (where ‘xxx’ is replaced by the id value to be assigned to the table, as in the following example:


{:sort-table: ideas-table}

This command will inject JavaScript into the resulting HTML page, allowing the viewer to click on any table heading in order to sort the table by the values in that column.

Numbers will be sorted numerically.

Other values will be sorted by their alpha values, ignoring case (upper- or lower).

Clicking again on a column will reverse the sort, so that values appear in descending sequence.


Next: Supply a Page Header