If you translate your recordset into an array then you can loop through the
indexes any way you like. Usually, row column output works this way:
for rCounter = 0 to ubound(myArray, 2)
response.write "<tr>"
for cCounter = 0 to ubound(myArray)
response.write "<td>" & myArray(cCounter, rCounter) & "</td>"
next
response.write "</tr>"
next
Seems to me you could swap the two loops, so:
for cCounter = 0 to ubound(myArray)
response.write "<tr>"
for rCounter = 0 to ubound(myArray, 2)
response.write "<td>" & myArray(cCounter, rCounter) & "</td>"
next
response.write "</tr>"
next
Haven't tried it, but that'd be my first inclination.
- Wm
--
William Morris
Semster, Seamlyne reProductions
Visit our website,
http://www.seamlyne.com, for the most comfortable
historically inspired clothing you can buy!
"Bennie Sanders" <bennie@clickfocal.com> wrote in message
news:uEchRZxGEHA.2844@tk2msftngp13.phx.gbl...[color=blue]
>
> Hi there,
>
> I have a SQL 2000 table with data I display in three columns. The code
> I am using sorts the data horizontally but I need it sorted vertically.
> Here's the code I am using. Perhaps somebody can help me find a way to
> modify it.
>
>
> CODE
> response.write "<table width='100%' cellpadding=1 cellspacing=0>"
> if not oMain.eof then
> count = 0
> do while not oMain.eof
> if count mod 3 = 0 then
> 'there are 3 in the current row, so end the row and start a new
> one...
> response.write "</tr><tr>"
> end if
>
> 'add the item number to another column
> response.write "<td valign=top><ul><li>" & oMain("catcode")
>
> 'increment the count
> count = count+1
>
> oMain.MoveNext
> loop
> Response.Write "</table>"
> end if
>
> It's displaying 1 2 3 across instead of down and starting the next
> column with 4. I hope I am making sense. Thank you very much.
>
>
> *** Sent via Developersdex
http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]