Fellow ASP Programmers,
I have a question that I know someone in here can help me with.
I am trying to loop through a recordset horizontally. What I mean is; I have a list of products in a table. Right now I have them looping 20 at a time vertically one after another.
I need to be able to have these products loop 3 columns wide and then however many rows doesn’t matter.
So I will get something like this:
Product 1 Product 2 Product 3
Instead of:
Product 1
Product 2
Product 3
Here is the code I am using now:
' Build Content String
If Not oProducts.EOF Then
Do Until oProducts.EOF OR iCounter = 20
' Math function for percentage values
sPercentValue = 1 - (CDBL(oProducts("Current Price").Value)/CDBL(oProducts("Old Price").Value))
sPercentValue = sPercentValue
If oProducts("Priority") = "2" Then
' Build out content string for normal items
strBuild = "<TABLE width=""200"" border=""0"" cellspacing=""0"" cellpadding=""5"">"
strBuild = strBuild & "<TR><TD><P>"
strBuild = strBuild & "<IMG src=" & oProducts("Thumbnail Image").Value & " border=""1""><BR clear=""all""><FONT face=""Verdana, Arial, Helvetica, sans-serif"" size=""1""><A href=""#"">" & oProducts("Item Name").Value & "</A>"
strBuild = strBuild & "<BR clear=""all""><S>" & FormatCurrency((oProducts("Old Price").Value), 2, -2, -2, -2) & "</S> | " & FormatCurrency((oProducts("Current Price").Value), 2, -2, -2, -2) & "<BR clear=""all"">you save " & FormatPercent((sPercentValue), 0, -2, -2, -2) & "</FONT>"
strBuild = strBuild & "</P></TD></TR>"
strBuild = strBuild & "</TABLE>"
sDisplay = sDisplay & strBuild
ElseIf oProducts("Priority") = "1" Then
' Build out content string for featured items
strBuild = "<TABLE width=""200"" border=""0"" cellspacing=""0"" cellpadding=""5"">"
strBuild = strBuild & "<TR><TD><P>"
strBuild = strBuild & "<IMG src=" & oProducts("Thumbnail Image").Value & " border=""1""><BR clear=""all""><FONT face=""Verdana, Arial, Helvetica, sans-serif"" size=""1""><A href=""#"">" & oProducts("Item Name").Value & "</A>"
strBuild = strBuild & "<BR clear=""all""><S>" & FormatCurrency((oProducts("Old Price").Value), 2, -2, -2, -2) & "</S> | " & FormatCurrency((oProducts("Current Price").Value), 2, -2, -2, -2) & "<BR clear=""all"">you save " & FormatPercent((sPercentValue), 0, -2, -2, -2) & "</FONT>"
strBuild = strBuild & "</P></TD></TR>"
strBuild = strBuild & "</TABLE>"
sFeatured = sFeatured & strBuild
End If
oProducts.MoveNext
Loop
End If
If anyone can help I would appreciate it greatly.
Thanks,
Jared