Discussion Locked

ASP and tables

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have folders full of thumbnails - let's say FoodFolder and ColorsFolder. A user selects, from a drop-down box, to see Food. A page is displayed with all thumbnail from the FoodFolder. Problem is, they are "stacked" down the page instead of being in table cells. How do I get my ASP to insert these images in consecutive cells in an X x Y table?

11 replies

by mr. origami

Actually - I have it displaying in consecutive cells. Problem is - it is 1 looong table row. How do I make it create a new table row every 3 cells?

by raffi_

Try this bit:

<%
startrw = 0
endrw = HLooper1__index
numberColumns = 3
numrows = 3
while((numrows <> 0) AND (Not Your_RecordSet.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%>

<%
While ((startrw <= endrw) AND (Not Your_RecordSet.EOF))
%>

<%
startrw = startrw + 1
Your_RecordSet.MoveNext()
Wend
%>

<%
numrows=numrows-1
Wend
%>

<%=(GET_Q.Fields.Item("Field_Value").Value)%>

Regards
Raffi_

by mr. origami

This might work - but I'm new to ASP. Need a bit more hand-holding. What should I replace the following with (or do they need to be replaced?)
HLooper1__index
Not Your_RecordSet.EOF
GET_Q.Fields.Item("Field_Value").Value
Wend
And does this limit me to a 3x3 table? I need a constant of 3 columns, but the rows should adjust dynamically depending on how many images are in my "images" directory. Thanks!!

by mr. origami

I should mention this is not tied to a database - so I don't understand Raffi's mention of a "record set" below. My ASP code looks in a folder of images and starts with "For Each file in filecollection"

by rsv

HI,
Try this....if u r using
"For each file in filecollection"

<%For each file in filecollection %>

<% for icells=0 to 2 %>

<% next
icells=0 %>

<% next %>

<%=file%>

Hopethis helps you.
GOOD LUCK...:)

by rsv

HI the above code will create a new row for every 3 cells, so if u want to have a new table for every 3 cells...write this...

<%For each file in filecollection %>

<% for icells=0 to 2 %>

<% next
icells=0 %>

<%=file%>

<% next %>

This discussion is closed to new replies.