General discussion

Locked

ASP and tables

By Mr. Origami ·
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?

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

ASP and tables

by Mr. Origami In reply to ASP and tables

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?

Collapse -

ASP and tables

by Raffi_ In reply to ASP and tables

Try this bit:
<table>
<%
startrw = 0
endrw = HLooper1__index
numberColumns = 3
numrows = 3
while((numrows <> 0) AND (Not Your_RecordSet.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%>
<tr align="center" valign="top"> <%
While ((startrw <= endrw) AND (Not Your_RecordSet.EOF))
%>
<td> <%=(GET_Q.Fields.Item("Field_Value").Value)%> </td>
<%
startrw = startrw + 1
Your_RecordSet.MoveNext()
Wend
%>
</tr>
<%
numrows=numrows-1
Wend
%>
</table>

Regards
Raffi_

Collapse -

ASP and tables

by Mr. Origami In reply to ASP and tables

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!!

Collapse -

ASP and tables

by Mr. Origami In reply to ASP and tables

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"

Collapse -

ASP and tables

by RSV In reply to ASP and tables

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

<table border=1 width=500>
<%For each file in filecollection %>
<tr>
<% for icells=0 to 2 %>
<td><%=file%></td>
<% next
icells=0 %>
</tr>
<% next %>
</table>

Hopethis helps you.
GOOD LUCK...:)

Collapse -

ASP and tables

by RSV In reply to ASP and tables

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 %>
<table border=1 width=500>
<tr>
<% for icells=0 to 2 %>
<td><%=file%></td>
<% next
icells=0 %>
</tr>
</table>
<% next %>

Collapse -

ASP and tables

by RSV In reply to ASP and tables

HI, check line 5. I hope u know how to display the image.

<td><img src=<%=file%>/td>

Collapse -

ASP and tables

by Mr. Origami In reply to ASP and tables

Getting an "Expected End" error. I'm new with ASP. Need to be spoon-fed. Thanks for the effort.

Collapse -

ASP and tables

by Raffi_ In reply to ASP and tables

A simple column counter should do the trick!
;-)

Collapse -

ASP and tables

by Mr. Origami In reply to ASP and tables

Got me thinking and problem is solved. Thanks for the private e-mails.

Back to Web Development Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums