Solved

Sort Jquery (multi sort tbody)

Posted on 2012-04-12
3
563 Views
Last Modified: 2012-06-04
im having some problems need help with organise data in tables.
 using Jquery (tablesorter.) when click to <th> tag, it sorts data in the 1st tbody but then in the 2nd, 3rd, and so on... it does not work

I can't delete (<thead><td>Category</td></thead>) because I want it fixed in position and sort data in tag tr
example:
<table class="tablesorter">
<thead>
<th>name</th>
<th>city</th>
<th>address</th>
</thead>
<tbody>
<thead><td>Category</td></thead>
<tr>
<td>content1</td>
<td>content2</td>
...
</tr>
</tbody>

<tbody>
<thead><td>Category1</td></thead>
<tr>
<td>content1</td>
<td>content2</td>
...
</tr>
</tbody>
<tbody>
<thead><td>Category2</td></thead>
<tr>
<td>subCategory</td>
<td>subCategory</td>
...
</tr>
</tbody>
</table>

Please help me. Thanks
0
Comment
Question by:vt96
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
basicinstinct earned 500 total points
ID: 37837025
first thing, your html is bad

you can't have nested thead elements inside the tbody elements

for example, you can't have this:

<tbody>
<thead><td>Category</td></thead>
...
</tbody>
0
 

Author Comment

by:vt96
ID: 37840771
Thanks your answer, but i want to sort data subcategory and my category is fixed in the positon. All subCategory (tbody 2nd )will sort below as tbody 1st.
You can preview link:
http://jsfiddle.net/8cg4f/115/
0
 

Author Closing Comment

by:vt96
ID: 38044126
Thanks for your help.  Although I found another solution, if you have additional ideas or third party control, please let me know.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question