This JavaScript can show a table of information either in normal or transposed view (called horizontal and vertical depending upon how the header lies.)
The method used for switching is that the form buttons call a function that sets a cookie and calls for a reload. The DisplayTable function checks for the cookie and selects which view to use.
This could use arrays of arrays as the data structure to simulate a multi-dimensional array instead of one long array and 2 increments. See Builder.Com: Superscripter: Sortable Tables Revisited for code that uses arrays of arrays.
I've also written a multiple table version that lets you display a dataset (array) as multiple tables, specifying start and end rows for each table. It also adds a table header row for each table.
This script is written from scratch by Jeff Wilkinson, 5/25/2000. You are free to use and modify it, though it would be nice if you'd let me know.