Hello, I've been scouring the internet trying to find a way to do this with jQuery. My situation is this, I have a tablesorter function (using the jQuery plugin tablesorter) in an external scripts.js file as follows:
$(function() { $(aTable).tablesorter({ // Go through each column and sort date according to type of data in the column }); }); In my html file I have it declared in my head as follows: <script type="text/javascript" src="starterkit/jquery-1.3.2.js"></ script> <script type="text/javascript" src="starterkit/ jquery.tablesorter.js"></script> <script type="text/javascript" src="starterkit/scripts.js"></script> <script type="text/javascript"> var aTable = $("#myTable"); var columns = $("#myTable tbody th:").length; </script> What I want to do is pass the aTable and columns variables to the external function and use a for loop to cycle through each column to determine a) should the column be sorted or not and b) if it is to be sorted, what kind of data is in the column? Add a special parser depending on this data, i.e. if the column contains a date, add a date parser, etc. I'm completely stuck, any hints are appreciated.