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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:01:16+00:00 2026-05-30T15:01:16+00:00

I have table: <table id=myTable class=tablesorter> <thead> <tr> <th>name</th> <th>secondname</th> <th>E-mail</th> <th>Salary</th> <th>web site</th>

  • 0

I have table:

<table id="myTable" class="tablesorter">
  <thead>
  <tr>
    <th>name</th>
    <th>secondname</th>
    <th>E-mail</th>
    <th>Salary</th>
    <th>web site</th> 
  </tr>
  </thead>
  <tbody>
  <tr>
    <td>Smit</td>
    <td>Jonson</td>
    <td></td>
    <td>$50.00</td>
    <td>yes</td>
  </tr>
  <tr>
    <td>Smit2</td>
    <td>Jonson2</td>
    <td></td>
    <td>$20.00</td>
    <td>yes</td>
  </tr>
  <tr>
    <td>Bah</td>
    <td>Frank</td>
    <td>fbach@yahoo.com</td>
    <td>$40.00</td>
    <td>no</td>
  </tr>
  <tr>
    <td>Dou</td>
    <td>jenson</td>
    <td></td>
    <td>$100.00</td>
    <td></td>
  </tr>
  <tr>
    <td>Kortni</td>
    <td>Love</td>
    <td></td>
    <td>$50.00</td>
    <td></td>
  </tr>
  </tbody>
</table>

How sort my table that would simultaneously three conditions:
1 condition: E-mail = empty and web site = yes and Salary = ascending;
Then go string with 2 condition: E-mail – not empty and web site = no and Salary = ascending;
Then strings – other.
Sort with JavaScript(use jQuery). All data for table come from Spring Controller.
Rresult:

 name   secondname  E-mail       Salary           web site
   Smit2    Jonson2                  $20.00                  yes   
   Smit     Jonson                   $50.00                  yes
    Bah     Frank      fbach@yahoo.com   $40.00                   no
    Bah     Frank      fbach@yahoo.com   $330.00                  no
    Kortni  Love                     $50.00     
    Dou     jenson                   $100.00    
  • 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-30T15:01:18+00:00Added an answer on May 30, 2026 at 3:01 pm

    Use data tables – http://datatables.net/

    Its a great plugin for jQuery and here is a great example of how to do multi-column sorting – http://datatables.net/release-datatables/examples/basic_init/multi_col_sort.html

    /* Define two custom functions (asc and desc) for string sorting */
    jQuery.fn.dataTableExt.oSort['string-case-asc']  = function(x,y) {
        return ((x < y) ? -1 : ((x > y) ?  1 : 0));
    };
    
    jQuery.fn.dataTableExt.oSort['string-case-desc'] = function(x,y) {
        return ((x < y) ?  1 : ((x > y) ? -1 : 0));
    };
    
    $(document).ready(function() {
        /* Build the DataTable with third column using our custom sort functions */
        $('#example').dataTable( {
            "aaSorting": [ [0,'asc'], [1,'asc'] ],
            "aoColumns": [
                null,
                null,
                { "sType": 'string-case' },
                null,
                null
            ]
        } );
    } );
    

    UPDATE

    Based on your question, you would look for something like this:

    ...
        "aaSorting": [ [2,'asc'], [4,'asc'], [3, 'asc' ],
    ...
    

    Which is Email, Web Site, Salary (zero-based column 2, 4, and 3). If that doesn’t do it perfectly, switch out ‘asc’ for ‘desc’ where needed.

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

Sidebar

Related Questions

I have this: <table id=myTable style=width: 650px;> <thead> <tr style=font-weight: bold;> <td>Name</td> <td>Price</td> <td>Supplier</td>
I have a Data Class called MyTable, and the source property is TABLE (table
I have the following mapping for my table in MySql: <class name=Tag, namespace table=tags
I have a table as below; <table id=mytable> <tr> <td>cola1</td> <td>cola2</td> <td>cola3</td> <td class=rem>cola4</td>
I have a table like that: <table id=myTable cellspacing=0 cellpadding=10 border=0 width=100%> <tbody> ....
I have a table myTable with myGuid (uniqueidentifier), myValues (float), myGroup (integer) and a
For example I have a table MyTable like this: Id Value Rate 1 10
I am using T/SQL in SQL Server 2008 I have a table MyTable with
I have a table named myTable on SQL Server 2008 R2 Express. I would
Say I have a table: <table id=#myTable> <tr> Section 1 <td> <table> <tr> Sub

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.