This version of the sortable table script reads data from an XML file - in this case stocks.xml, and writes it to a dynamically-created table. Table headers are generated automatically from the element names in the XML file. The script will accept data arranged in up to 26 columns which should be sufficient for all practical purposes. Clicking on the table header cells will cause the table to be sorted. The demo is configured to sort numerical values in descending numerical order and text values in ascending alphabetic order. This configuration can be readily altered. Text values are sorted in strictly alphabetic order whether they begin with upper case or lower case letters.
The script uses the Microsoft ActiveX object XMLDOM, and is therefore only viewable in Internet Explorer
View the XML source file
(Note - the above data is from the London Stock Exchange 25/1/2001)