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 7618347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:22:50+00:00 2026-05-31T03:22:50+00:00

This sorts in one direction, but not the other. Is there something wrong with

  • 0

This sorts in one direction, but not the other. Is there something wrong with the table specifications. It wold be great if someone could post an HTML sample that has sorting working in both directions on a column with dollar values that include commas in them.

// create sorter
<script type="text/javascript" id="js">
    $(document).ready(function() {
        // call the tablesorter plugin
        $("table.tablesorter").tablesorter({
            // enable debug mode
            debug: false
        });
    }); 
</script>

Not sure if a prefix is needed here (table.tablesorter):

// add parser through the tablesorter addParser method
<script type="text/javascript" id="js">
$.tablesorter.addParser({
    // set a unique id
    id: 'money',
    is: function(s) {
        // return false so this parser is not auto detected
        return false;
    },
    format: function(s) {
         return s.toLowerCase().replace("\$","").replace(",","");
    },
    // set type, either numeric or text
    type: 'numeric'
});

Not sure if table.tablesorter is needed here:

// specify column  
$(function() {  
    $("table.tablesorter").tablesorter({  
        headers: {  
            // column to be handled specially
            7: {  
                sorter:'money'  
            }  
        }
    });
});                 
</script>

The following is the top of the table:

<table cellspacing="1" class="tablesorter">  
    <thead>  
        <tr>  
            <th>Name</th>  
            <th>Major</th>  
            <th>Gender</th>  
            <th>English</th>  
            <th>Japanese</th>  
            <th>Calculus</th>  
            <th>Overall grades</th>  
            <th>Money</th>  
        </tr>  
    </thead>  
    <tbody>  
        <tr>  
            <td>Student01</td>  
            <td>Languages</td>  
            <td>male</td>  
            <td>80</td>  
            <td>70</td>  
            <td>75</td>  
            <td>bad</td>  
            <td>$1.00</td>  
        </tr>  
  • 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-31T03:22:51+00:00Added an answer on May 31, 2026 at 3:22 am

    Since you are working with numbers, you’ll need to parse the string into a real number. Change this line in your parser:

    format: function(s) {
      return parseFloat( s.toLowerCase().replace("\$","").replace(",","") );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question might belong on one of the other trilogies, but it sorta seemed
This is a general question of sorts, but do you think that it's important
I thought this would be pretty easy but I'm running into all sorts of
They brush the subject in this thread, but it does not really answer much:
Apologies for using someone else's brain for this, but I'm sure this is a
I want a sorta basic answer on this one, just a little guidance but
This one is sort of twisting my noodle. I have something resembling this (in
For some reason, one of my Ruby on Rails classes produces this sort of
Ok so I have a number of methods that look like this:- which sorts
This function appears to be a way to access all sorts of system values.

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.