0

I need to reorder the following table based on the last column value only from highest to lowest. (The Donation Total) without adding a sort option for the other columns. Any help would be greatly appreciated.

<table>
<tbody><tr>
<td colspan="4"><b>Click on the Team for Participant information: </b></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><b>Team Name</b></td>
<td><b>Team Captain</b></td>
<td><b>Donation Total</b></td>
</tr>

<tr><td></td>
<td><a href="#">another team</a></td>
<td>billy bob</td>
<td>CAN$0.00</td>
</tr>

<tr><td></td>
<td><a href="#">this team</a></td>
<td>jo schmo</td>
<td>CAN$3.00</td>
</tr>

<tr><td></td>
<td><a href="#">test team</a></td>
<td>john doe</td>
<td>CAN$2.00</td>
</tr>

</tbody></table>

I attempted using jQuery table sort but was unable to get it to work, received Undefined error message.

Any help would be greatly appreciated, here is a link to jsfiddle with the HTML in it http://jsfiddle.net/jelane20/pd4sY/

Community
  • 1
  • 1
Jenny
  • 781
  • 1
  • 9
  • 24
  • [Try this plugin](http://tablesorter.com/docs/) - seems to be very easy to use - [example](http://jsfiddle.net/peteng/pd4sY/3/), all you need is a set of `th`s in a `thead` and include the script – Pete Jun 11 '14 at 14:41
  • Unfortunately, I am not able to edit the table, it is automatically generated and there is no th tag. Maybe add that using jquery then use the plugin? Or is there a better way? – Jenny Jun 13 '14 at 17:09
  • I have added a couple of examples of sorts for the last column only (one that allows sorting and the other that just sorts and then doesn't allow sorting) – Pete Jul 03 '14 at 08:05

0 Answers0