Very roughly you could do something like the following:
Store all the information in your table in a Javascript multi-dimensional array
In your HTML have your table within a <DIV></DIV> tags
When the user clicks on a column heading in your table, this will call a function which sorts your array by the chosen column, generates the table HTML on the fly and writes it to the DIV using the innerHTML property.
Hi,
this script should set up a table for you using DOM ( sorry if there's typos as its untested ), all you really need to do is build each element of the table as an object. You can then use the insertBefore method to create it as below, or you could also use the swapNode or removeNode methods as well
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.