Topic: Rearranging table columns with drag and drop?

I'm trying to implement an interface where the columns of a table could be rearranged by drag and drop and the order of the columns saved for later use.  I have Javascript code to allow the rearranging of the columns, but no way to save the order for later.  Does anyone know of a way to export the table headers in a table on a button click or something else that will work for this?