Hi All
Somebody kindly sent me a routine to do this sometime ago, but for the life
of me I can't work out how it works and would prefer to use a simpler method
so that I can resolve any future issues with it.
Basically I have an array populated from a recordset getrows and I want to
create a nicely formatted table of this data with all of the right columns.
If my array consists of 8 rows of data and I want my table to display this
array 3 columns wide then the routine needs to make sure that it drops the
array rows onto enough table rows to show them all, eg:
< data1 > < data1 > < data1 >
< data1 > < data1 > < data1 >
< data1 > < data1 > < create the <TD></TD> bit but obviously leave it
blank >
Any help you can give would be very much appreciated.
The code I currently use, but don't understand is as follows:
Response.Write "<TABLE CELLSPACING=0 CELLPADDING=0 CLASS='ProdFullDesc'
BORDER=0>"
intArrayCount = UBound(arrSQLData,2)
intStartRow = 1
IF intArrayCount mod 3 = 0 THEN
intColDiff = CInt(intArrayCount \ 3)
ELSE
intColDiff = CInt(intArrayCount \ 3) + 1
END IF
FOR x = 1 TO intColDiff
Response.Write "<TR>"
intTargetRow = intStartRow
z=0
FOR y = 0 to intArrayCount
IF y = intTargetRow-1 THEN
Response.Write "<TD ALIGN='CENTER'><IMG SRC='"
Response.Write cImageGalleryFolderPath & arrSQLData(0,y) & "'
BORDER=0><BR>"
Response.Write arrSQLData(1,y) & "</TD>"
intTargetRow = intTargetRow + intColDiff
END IF
NEXT
Response.Write "</TR><TR><TD COLSPAN=" & intColDiff & "
HEIGHT=10></TD></TR>"
intStartRow = intStartRow + 1
NEXT
Response.Write "</TABLE><BR>"