Note that there are some explanatory texts on larger screens.

plurals
  1. POComplex sort html table
    text
    copied!<p>I have table:</p> <pre><code>&lt;table id="myTable" class="tablesorter"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;name&lt;/th&gt; &lt;th&gt;secondname&lt;/th&gt; &lt;th&gt;E-mail&lt;/th&gt; &lt;th&gt;Salary&lt;/th&gt; &lt;th&gt;web site&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Smit&lt;/td&gt; &lt;td&gt;Jonson&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;$50.00&lt;/td&gt; &lt;td&gt;yes&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Smit2&lt;/td&gt; &lt;td&gt;Jonson2&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;$20.00&lt;/td&gt; &lt;td&gt;yes&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Bah&lt;/td&gt; &lt;td&gt;Frank&lt;/td&gt; &lt;td&gt;fbach@yahoo.com&lt;/td&gt; &lt;td&gt;$40.00&lt;/td&gt; &lt;td&gt;no&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Dou&lt;/td&gt; &lt;td&gt;jenson&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;$100.00&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Kortni&lt;/td&gt; &lt;td&gt;Love&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;$50.00&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>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:</p> <pre><code> 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 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload