Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 594
  • Last Modified:

Sort Jquery (multi sort tbody)

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
vt96
Asked:
vt96
  • 2
1 Solution
 
basicinstinctCommented:
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
 
vt96Author Commented:
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
 
vt96Author Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now