how to seperate the listing in 2 columns by ASP

W

work4u

Hello,

I am working on a page which listing all product in one page, by
should be in 2 column rather than just one.

PS: i can do show up all products in 1 column by do while not loop,...

can anyone reply with some simple asp code, just the code for seperate
the listing in 2 column...

many thanks

sample link as belowed

http://www.discountcontactlenses.com/lensindex.asp?S=LS
 
T

TomB

Dim lngColumnCount
lngColumnCount=0
if not RS.EOF then
Response.Write "<tr>"
Do while not RS.EOF
Response.Write "<td>" & RS.Fields(0) & "</td>"
lngColumnCount=lngColumnCount+1
if lngColumnCount=2 then
Response.Write "</tr><tr>"
lngColumnCount=0
end if
RS.MoveNext
Loop
Response.Write "<td colspan=" & 2-lngColumnCount & ">&nbsp;</td></tr>"
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top