Link to home
Start Free TrialLog in
Avatar of Gangadhara Melukote
Gangadhara MelukoteFlag for United States of America

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.
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points! Have a nice week-end!