"Milton Snider" wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
: "Roland Hall" wrote in message
: news:O5**************@TK2MSFTNGP12.phx.gbl...
: > "Milton Snider" wrote in message
: > news:OM**************@TK2MSFTNGP14.phx.gbl...
: > :I have a table of about 20 Categories. I currently have them displayed
: > : accross the page in a table from left to right in 3 columns. like
this:
: > : abuse cmecf credit/etc
: > : dismissal presumptions
: > :
: > : You will notice the sort runs from left to right. I would like the
sort
: > to
: > : run vertically like this:
: > : abuse dismissal
: > : cmecf presumptions
: > : credit/etc
: > :
: > : I am outputting from an access table into an html table via asp. Does
: > : anyone have a trick to get the output the way I want it.
: > : Could I populate an array and then output like this:
: > :
: > : array(1) array(4) array(7)
: > : array(2) array(5) array(8)
: >
: > Assume rs is the recordset variable and arr is the 2-dimensional array
: > created using GetRows()
: >
: > If you used GetRows, you can easily do this.
: >
: > Const numColumns = 3
: > dim numRecords, arr, rowCounter, colCounter, displayName
: >
: > ' connect to database and return data
: >
: > arr = rs.GetRows()
: >
: > Response.Write "<table width=""100%"">"
: > numRecords = ubound(arr,2) + 1
: > if numRecords mod numColumns = 0 then
: > numRows = numRecords\numColumns
: > Else
: > numRows = numRecords\numColumns + 1
: > End if
: >
: > For rowCounter = 1 to numRows
: > Response.Write "<tr>"
: > For colCounter = 0 to numColumns - 1
: > If rowCounter + colCounter * numRows <= numRecords then
: > displayName = arr(0, rowCounter + colCounter * numRows - 1)
: > Response.Write "<td style=""width: 33%"">" & arr(1, rowCounter +
: > colCounter * numRows - 1) & displayName & "</td>"
: > Else
: > Response.write "<td> </td>"
: > end if
: > Next
: > Response.Write "</tr>"
: > Next
: >
: > I've done this with two columns. I've made some changes to work with 3
: > but
: > it's not tested.
I got the idea a long time ago from a guy name Pete Draigh @
businessstrategy.com
Glad it worked for you.
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp