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

  • Home
  • SEARCH
  • 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 8340719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:15:27+00:00 2026-06-09T05:15:27+00:00

I am using tablesorter and I’m trying to figure out how to sort a

  • 0

I am using tablesorter and I’m trying to figure out how to sort a column with multiple divs. Specifically I need to sort the column by the percentage in the “prog-perc” div.

I’ve struggled with understanding the custom parser/text extraction so if possible I’m looking for an answer that explains the process.

HTML

<td class="transaction-table-hide">
  <span class="status">&{enums.Select.ISCTDealStatus.values()[transaction?.status].name}</span>
   <div class="prog-container">
     <a href="#" class="form-info" rel="tooltip" title="">
     <div class="progress rounded clearfix">
       <div class="prog-quart fl">&nbsp;</div>
         <div class="prog-half fl">&nbsp;</div>
         <div class="prog-three-quart fl">&nbsp;</div>
          <div class="prog-perc">10%</div>
      </div>
      </a>
    </div>
 </td> 

$.tablesorter.addParser({ 
        id: 'currencyExtract', 
        is: function(s) { 
            return false; 
        }, 
        format: function(s) { 
            return s
            .replace(/ AUD/,0)
            .replace(/ BHD/,0)
            .replace(/ BBD/,0)
            .replace(/ CAD/,0)
            .replace(/ CNY/,0)
            .replace(/ HRK/,0)
            .replace(/ CZK/,0)
            .replace(/ DKK/,0)
            .replace(/ XCD/,0)
            .replace(/ EGP/,0)
            .replace(/ MTL/,0)
            .replace(/ EUR/,0)
            .replace(/ HKD/,0)
            .replace(/ HUF/,0)
            .replace(/ INR/,0)
            .replace(/ ILS/,0)
            .replace(/ JMD/,0)
            .replace(/ JPY/,0)
            .replace(/ JOD/,0)
            .replace(/ KES/,0)
            .replace(/ LVL/,0)
            .replace(/ LTL/,0)
            .replace(/ MUR/,0)
            .replace(/ MXN/,0)
            .replace(/ MAD/,0)
            .replace(/ NZD/,0)
            .replace(/ NOK/,0)
            .replace(/ OMR/,0)
            .replace(/ PLN/,0)
            .replace(/ GBP/,0)
            .replace(/ QAR/,0)
            .replace(/ RON/,0)
            .replace(/ RUB/,0)
            .replace(/ SAR/,0)
            .replace(/ SGD/,0)
            .replace(/ ZAR/,0)
            .replace(/ SEK/,0)
            .replace(/ CHF/,0)
            .replace(/ THB/,0)
            .replace(/ THD/,0)
            .replace(/ TRY/,0)
            .replace(/ AED/,0)
            .replace(/ USD/,0)
            ;
        },
        type: 'numeric' 
    }); 

   $("#sorTable").tablesorter({
        headers:{
            1:{
                sorter: 'shortDate'
            },
            3:{
                sorter: 'currencyExtract'
            },
            4:{
                sorter: 'currencyExtract'
        },
            5:{
                sorter: false
            }
        },
        textExtraction: function(node){
            return node.childNodes[0].nodeValue;
        },
        /*textExtraction: function(node) { 
            var $n = $(node), $p = $n.find('.prog-perc');
            return $p.length ? $p.text() : $n.text(); 
        },*/
        widgets: ['zebra'],
        dateFormat: "uk"
   }).tablesorterPager({container: $("#pager")});
  • 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-06-09T05:15:29+00:00Added an answer on June 9, 2026 at 5:15 am

    Use the textExtraction option to target that div (demo)

    $('table').tablesorter({
            // define a custom text extraction function 
            textExtraction: function(node) { 
                var $n = $(node), $p = $n.find('.prog-perc');
                // extract data from markup and return it
                return $p.length ? $p.text() : $n.text(); 
            } 
    });
    

    ​Don’t worry about the % sign as the percentage parser should detect it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery Tablesorter with Zebra widget on multiple tables. What i'm trying to
When using tablesorter I cannot sort out properly when I add something to say
I have multiple tables using tablesorter on a page but only need to show
Using Jquery TableSorter, I am creating a custom parser to sort elapsed time <td>
am using jquery tablesorter plugin and in my country column i got special characters
I am using the jQuery tablesorter plugin to sort a gridview in an asp.net
I'm currently using tablesorter to sort a set of graphs. I achieve this by
I am Using http://tablesorter.com/docs/example-options-headers.html $(#sort-table).tablesorter( {headers: { 0: { sorter: false }, dynamic_value: {
I'm using the jQuery tablesorter plugin to sort a table, which assigns .click() handlers
I am using jQuery tablesorter to sort a table and would like to produce

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.