cgi sorting table

Cliff Wells clifford.wells at
Mon Sep 13 08:12:44 CEST 2004

On Mon, 2004-09-13 at 05:55 +0000, someguy wrote:
> Hi guys,
>     	I'm using Python to generate a cgi web page with a table.  What I 
> want to do is able to sort the table when the user clicks on a table 
> header.  I'm trying to avoid using DOM and instead just want to use python 
> to generate a new page.  Any ideas?

Just have the table header be a link that POSTs back to your cgi script
with the index of the column.  You don't give a lot of information here,
but I'm guessing your table is generated from a Python list, so just use
the list's sort() method, then redisplay the page.


Cliff Wells <clifford.wells at>

More information about the Python-list mailing list