Gangadhara Melukote
asked on
table header onclick sort
Hi All,
I am displaying a simple table in the web page. The values for this table are directly coming from database. Now I need to provide 'sort' option based on the table column header.
Just an example 'Head1', 'Head2', 'Head3' are the table headers (1st row). On click of 'Head1' the table rows should be sorted based on 'Head1' value in ascending order. On second click of 'Head1' it should sort in descending order. Aslo please let me know how to provide 'up arrow' and 'down arrow' mark in the column head which indicates 'the table is sorted based on which column and the order is ascending or descending.'
Please let me know if this functionality is possible through javascript or dhtml. Any sample code will be great helpfull for me.
I am displaying a simple table in the web page. The values for this table are directly coming from database. Now I need to provide 'sort' option based on the table column header.
Just an example 'Head1', 'Head2', 'Head3' are the table headers (1st row). On click of 'Head1' the table rows should be sorted based on 'Head1' value in ascending order. On second click of 'Head1' it should sort in descending order. Aslo please let me know how to provide 'up arrow' and 'down arrow' mark in the column head which indicates 'the table is sorted based on which column and the order is ascending or descending.'
Please let me know if this functionality is possible through javascript or dhtml. Any sample code will be great helpfull for me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points! Have a nice week-end!
http://tablesorter.com/docs/