Exclude a column from being sorted using jQuery tablesorter

后端 未结 8 1766
有刺的猬
有刺的猬 2021-02-01 21:30

I am looking for a way to exclude a single column from being sorted using jQuery\'s tablesorter plugin. Specifically, I have a fairly large table and would like to keep a \"row

8条回答
  •  别那么骄傲
    2021-02-01 22:07

    The answer of Stobor is perfect. The only problem is that needs to wait until the table is rendered completly to put the numbers.

    Some observations:

    • You need to give an empty column for this method put the numbers.
    • If you have headers in the table you have to use the tags THEAD and TBODY to let tablesorter to sort only the data in the TBODY section.
    • If you have a footer in your tables, you have to let this out of the TBODY section to avoid tablesorter to sort his content, also you have to use tags TH instead TD to avoid numerating the footer.

    Note: The method shown by Abdul only restricts to the user to sort by the indicated columns, but his content is always ordered with the rest of the row when an order by other unrestricted column is selected.

提交回复
热议问题