This script reads data from a text file - in this case stocks.txt, and writes it to a dynamically-created table. 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.
(Note - the above data is from the London Stock Exchange 25/1/2001)