One way (of many) is to create two variables hold alternate values from the
recordset
Dim column1, column2
Dim counter
column1 = "<td width=50%>"
column2 = "<td width=50%>"
' Initialize the counter
counter = 0
' This is your while loop
While. ...
' Alternate adding value to the string
If counter Mod 2 = 0 Then
' Add the checkbox and recordset value to the first string
column1 = column1 & "<input type=checkbox ....." &
rsFeedback("....")
Else
' Add the checkbox and recordset value to the second string
column2 = column2 & "<input type=checkbox ....." &
rsFeedback("....")
End If
' Complete the TD tag
column1 = column1 & "</td>"
column2 = column2 & "</td>"
' Now, print the values of these variables
Response.Write("<table><tr>")
Response.Write(column1)
Response.Write(column2)
Response.Write("</tr></table>")
rsFeedback.MoveNext
Wend
This is not the most efficient way, since you are concatenating strings.
Another way, especially if you have a count of records (say using
disconnected recordset), is to use RecordCount property of the recordset to
count upto the half for one TD, and start another TD, and Response.Write all
the way:
' Make sure you can somehow read recordcount (disconnected RS, etc)
halfCount = Int(rsFeedBack.RecordCount/2)
Counter = 0
' Start the first TD
Response.Write("<table><tr>")
Response.Write("<td>")
' This is your while loop
While. ...
' Check to see if half the count has passed
If counter > halfCount Then
' End the previous TD and Start a new TD
Response.Write("</td><td>")
End If
' Print the values
Response.Write("<input type=checkbox....>")
Response.Write(rsFeedback("..."))
rsFeedback.MoveNext
Wend
Hope that helps.
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Raphael Gluck" <so***@nospam.com> wrote in message
news:eE**************@TK2MSFTNGP11.phx.gbl...
Hi
I have a simple ASP question.
I am experimenting a little with asp, and I am trying to view a page from
a database.
The thing is, i am seeing all my data, in one long column.
How can I split it up into two columns.
I have created a no jargon page, just for the example,
http://www.tripakltd.com/check.asp
the source code is
http://www.tripakltd.com/check.txt
I hope someone can help me with this
Thanks so much
Raphael