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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:15:09+00:00 2026-05-24T18:15:09+00:00

I’m running into difficulty when using the TableSorter jQuery plugin, if I have a

  • 0

I’m running into difficulty when using the TableSorter jQuery plugin, if I have a cell value with a date at the end.

I want to sort strictly by my text, but I think the plugin must be getting confused with the text because of the date. When I click the column header, the class does switch back and forth between headerSortUp and headerSortDown, but the rows don’t get sorted.

Here’s an example:

<table id="tbl1">
    <thead>
        <tr>
            <th><a href="#" onclick="return false;">Col1</a></th>
            <th><a href="#" onclick="return false;">Col2</a></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>ZXY 123 10/31/2011</td>
            <td>2</td>
        </tr>
        <tr>
            <td>ABC 345 09/30/2011</td>
            <td>4</td>
        </tr>
        <tr>
            <td>DEF 345 08/31/2011</td>
            <td>6</td>
        </tr>
    </tbody>
</table>

If I remove the date at the end, or remove the number in the middle, or make the data less consistent it sorts fine. I’ve tried adding class="{sorter: 'text'} to the <th> element, with no effect, and I’ve also tried my own parser that just looks at the text itself, but still nothing.

I’ve got it up on JSFiddle at http://jsfiddle.net/y2z8z/

Any thoughts?

  • 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-24T18:15:09+00:00Added an answer on May 24, 2026 at 6:15 pm

    You cannot set the header config in the class attribute, it should be set in the headers config. Try this

    jQuery(document).ready(function() {
        jQuery("#tbl1").tablesorter({headers:{ 0: {sorter: 'text'} } });
    });
    

    Wordking demo

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.