Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 738795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:19:31+00:00 2026-05-14T08:19:31+00:00

I a couple of issues using Tablesorter 2.0.3. The first issue is when I

  • 0

I a couple of issues using Tablesorter 2.0.3.

The first issue is when I set a colspan on my table. Basically when I do this as below it doesn’t sort the respective columns.

<table> 
<thead> 
        <th colspan="3"></th>  
        <th>Four</th> 
        <th>Five</th>
        <th>Six</th>
        <th>Seven</th>  
</thead> 
<tbody> 
<tr> 
        <td>1</td> 
        <td>2</td> 
        <td>3</td> 
        <td>4</td>
        <td>5</td> 
        <td>6</td>
        <td>7</td>
</tr>  
</tbody> 
</table> 

The second issue I have is that no matter what I set the sortInitialOrder (“desc” or “asc”) in the tablesorter.js, it doesn’t have any effect to making the sort ascending or descending when it is clicked on.

Please can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:19:32+00:00Added an answer on May 14, 2026 at 8:19 am

    To solve problem one you can create your own mapping of headers to data cols. here’s what I did to get the functionality the way I wanted.

    I’ve added the following method to tablesorter.js:

    function findInMap(map, index, reverse) {
        for(var i = 0; i < map.length; ++i) {
            if(map[i][reverse ? 1 : 0] == index) return map[i][reverse ? 0 : 1];
        }
    
        return index;
    }
    

    And also added the following to this.defaults

    customMap: []
    

    The, change the following method:

    function setHeadersCss(table,$headers, list, css) {
        $headers.removeClass(css[0]).removeClass(css[1]);
    
        var h = [];
        $headers.each(function(offset) {
            if(!this.sortDisabled) {
                h[this.column] = $(this);                   
            }
        });
    
        var l = list.length; 
    
        for(var i=0; i < l; i++) {
            var header = list[i];
            var headerIndex = findInMap(table.config.customMap, header[0], true);
            h[headerIndex].addClass(css[header[1]]);
        }
    }
    

    Last but not least, add/change the following in $headers.click(function(e) {

    Add:

    var ia = findInMap(config.customMap, i, false);
    

    Change:
    config.sortList.push([i,this.order]); To config.sortList.push([ia,this.order]);

    When you init the tablesorter pass a customMap[[header_col_id, data_col_id]] In your case it’ll be:

    customMap[
        [2, 4],
        [3, 5],
        ...
    ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have couple of issues- the first constraint on select is loaded when reference
I've read a couple of posts on this issue but still can't seem to
I just started using C# and I've got a couple of issues. Is there
Basically a couple of issues here as the ui-slider ucas points & grades that
After having a couple of issues getting DQS installed , it appears to be
I'm having a couple of issues which may be related, or may not. I
Since I updated jQueryUI to 1.8 I found a couple of issues in our
I've been making an image uploader and I'm having a couple of issues. Code
For the last couple months i have ben having some issues with my app.config
I have a couple of things I'm working on, namely a page that issues

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.