Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to sort table columns using Table Sorter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 292
    Comment on it

    Follow the given steps: 1) Add the script in your page

    <script type="text/javascript" src="/path/to/jquery-latest.js"></script> 
    <script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script> 
    

    2) It will sort every column of your table

    jQuery("#myTable").tablesorter({debug: true});
    

    3) For disable sorting on the first & fifth column

    jQuery("#myTable").tablesorter({headers: { 0: {sorter: false},4: {sorter: false}}});
    

    4) This tells tablesorter to sort Second column in ASC and sixth column in DESC order.

    jQuery("#myTable").tablesorter({sortList: [[1, 0],[5, 1]]});
    

    Now when we will see that our table has become sortable.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: