Skip to content

How to specify the sort method for a column in a sortable table #3577

Answered by squidfunk
Stephen-Gates asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, it's not possible to add attributes to tables, which is a limitation of the Attribute Lists extension:

There are various HTML elements which are not represented in Markdown text, but only implied. For example, the ul and ol elements do not exist in Markdown. They are only implied by the presence of list items (li). There is no way to use an attribute list to define attributes on implied elements, including but not limited to the following: ul, ol, dl, table, thead, tbody, and tr.

You would need to provide your table as raw HTML in order to specify attributes. Other than that, you could also use JavaScript to add the class to the corresponding column before the table sort …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Stephen-Gates
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants