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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:46:41+00:00 2026-05-24T02:46:41+00:00

I’m using the jQuery Cupertino theme and want to use the icons from that

  • 0

I’m using the jQuery Cupertino theme and want to use the icons from that theme for the TableSorter plugin.

The TableSorter specs say that it has some properties that determine the background colour and the icons used for the heading cells depending on the sort state. For example, the cssAscproperty has a default value of headerSortUp and it has an example to set the icon and background-color for the headerSortUp class as follows:

th.headerSortUp { 
    background-image: url(../img/small_asc.gif); 
    background-color: #3399FF; 
} 

My problem is as follows:

  • I need to set a background-image url for the headerSortUp class, but when I look in the images that come with the Cupertino theme, all the icons are in a single PNG file and I don’t know how to access each one individually. How do I access the icons in this file individually?

  • The only way I know to set an icon in jQuery is to add a class to a span which is in a cell. I don’t think this method would work well for me here because the TableSorter works in a particular way and like I said above, I think I need to set the background-image of some of the cells, so this class can be added and removed by the TableSorter plugin. How should I be configuring the TableSorter cssAsc property so that I can add the icons from the Cupertino theme?

Many thanks

  • 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-24T02:46:42+00:00Added an answer on May 24, 2026 at 2:46 am

    I recently added a fork of the TableSorter plugin on github with a list of all of the missing options and more examples. I’m not sure if you wanted to just add an icon to the header or change the sort direction arrows. If you want to add an icon, use the onRenderHeader function to add whatever content you want to the header. Here is an example.

    If you want to change the sort direction arrows then keep reading! I’m not sure which arrow icons you want to add but I just put together this widget for tablesorter (I’ll add the example page to the docs soon) using the thick arrow icons. If you want to use a different set of icons, look at the icons on this page and get the icon class name by hovering over it… Then you’ll need to modify the icons variable in the widget code below to target the icons you chose. The icon order is up/down arrow, down arrow and up arrow.

    Here is a demo and the code:

    $(function() {
    
      // add ui theme widget
      $.tablesorter.addWidget({
        id: "uitheme",
        format: function(table) {
          var c = table.config,
    
            // *** Modify the theme icons here ***
            // ["up/down arrow (cssHeaders, unsorted)", "down arrow (cssDesc, descending)", "up arrow (cssAsc, ascending)" ]
            icons = ["ui-icon-arrowthick-2-n-s", "ui-icon-arrowthick-1-s", "ui-icon-arrowthick-1-n"],
    
            klass, rmv = icons.join(' ');
          if (!$(c.headerList[0]).is('.ui-theme')) {
            $(table).addClass('ui-widget ui-widget-content ui-corner-all');
            $.each(c.headerList, function(){
              $(this)
                // using new "ui-theme" class in case the user adds their own ui-icon using onRenderHeader
                .addClass('ui-state-default ui-corner-all ui-theme')
                .append('<span class="ui-icon ui-theme"/>');
            });
          }
          $.each(c.headerList, function(){
            klass = ($(this).is('.' + c.cssAsc)) ? icons[1] : ($(this).is('.' + c.cssDesc)) ? icons[2] : icons[0];
            $(this).find('span.ui-theme').removeClass(rmv).addClass(klass);
          });
        }
      });
    
      // call the tablesorter plugin and apply the ui theme widget
      $("table").tablesorter({
        widgets : ['uitheme']
      });
    });
    

    You’ll also need to use this css instead of the blue/green themes

    /* jQuery UI Theme */
    table.tablesorter {
        font-family: arial;
        margin: 10px 0pt 15px;
        font-size: 8pt;
        width: 100%;
        text-align: left;
    }
    table.tablesorter thead tr th, table.tablesorter tfoot tr th {
        border-collapse: collapse;
        font-size: 8pt;
        padding: 4px;
    }
    table.tablesorter thead tr .header {
        background-repeat: no-repeat;
        background-position: center right;
        cursor: pointer;
    }
    table.tablesorter tbody td {
        padding: 4px;
        vertical-align: top;
    }
    table.tablesorter .header .ui-theme {
        display: block;
        float: right;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am reading a book about Javascript and jQuery and using one of the
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.