Click to See Complete Forum and Search --> : Sorting Table Columns


xoxLISAxox
12-21-2007, 02:58 AM
I have a table with 4 rows. Is it possible to give it a button on each row that will sort the data? For example, column 1 is name, column 2 is amount, column 3 is date. If the user clicks on colum 3, then the entire table is sorted by date?

Thank you.

chrisranjana
12-21-2007, 03:15 AM
Yes some custom functions can be programmed in php to do what you are asking.

TheRave
12-21-2007, 03:22 AM
How is the table populated? If its populated via a database the change its very easy; It just requires an addition to the SQL statement.

xoxLISAxox
12-21-2007, 04:14 AM
Hello Rave, very glad to see you again.

The table is manually edited by me, nothing fancy. Just a plain table in html format.

xoxLISAxox
01-08-2008, 02:46 PM
Anyone care to share?

hastx
01-08-2008, 03:05 PM
I would use javascript then. There are a few free ones out there. Here is one :
http://www.kryogenix.org/code/browser/sorttable/