Solved

Sort Jquery (multi sort tbody)

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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