I'd like to write my table in markdown text, but allow it to be sortable on github after its been rendered(simple asc/desc sorting by clicking on the column header.
Any way to do this?
How to Make Sortable Tables. Adding the "sortable" class to a <table> element provides support for sorting by column value. Clicking the column headers will sort the table rows by that column's value. Tables must use <thead> and <th> tags for sortable functionality to work.
Tables. To add a table, use three or more hyphens ( --- ) to create each column's header, and use pipes ( | ) to separate each column. For compatibility, you should also add a pipe on either end of the row.
This script allows a table to be sorted by the column headers, in ascending or descending order.
Table sort is not supported in Github flavored markdown but one alternative is to use user script such as Github Sort Content
It's very easy to install, for instance from Chrome :
install Tampermonkey
install Github Sort Content from Greasyfork
Then tables from github.com
markdown pages can be sorted like :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With