Solved

Sort Jquery (multi sort tbody)

Posted on 2012-04-12
3
527 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

WHY MVC is the future technology... As many of you know, MVC is Model,View,Controller pattern. Model View Controller pattern was invented in a Smalltalk context at Xerox in late 1970s. Why is this buzz about MVC: --------------------------- …
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now