Rohit Chopra Rohit Chopra - 1 year ago 70
jQuery Question

Sorting a table within a table

I am several tables within a big table and I am using jquery tablesorter for sorting the main table.

I would like to be able to sort the individual tables within the main table as well. Example code:

<table class="info tablesorter" border="0" cellspacing="0" cellpadding="0">

<th colspan>The Name</th>
<th colspan="5">Prospective clients</th>


<Tr class="parent" id="id_1" style='background-color: white'>

<TD style=vertical-align:middle>Main echo 1</td>
<TD style=vertical-align:middle>New York, NY</td>
<td colspan="5">55</td>
<tr class="child-id_1 expand-child" style="display:none">
<td colspan='7'>
<table class="ctable_1 ts2" width=75% id="class_id_1">

<th>Contact Page</th>
<th>Listed in next?</th>
<th>Created On</th>
<tr class='childofmarket'>
<td> xyz </td>
<td> aaa</td>
<td> ###-###-#### </td>
<td>- No -</td>
<tr class='childofmarket'>
<td> aak</td>

<td>- No -</td>

and so on. I keep getting the

Error: parsers[i] is undefined

Can anyone tell me what I need to fix here?

Answer Source

Don't know if you have tried but give all your tables the same class IE. sorted_table

please say which tablesorter you are using, I prefer this one Tablesorter

this in javascript use something like

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download