return recordset of images in specific cells in a table

D

David Shorthouse

Hello folks,

I have an interesting problem and am looking for some advice. I am
hoping to build an asp whereby records are pulled from SQL Server. These
records will be merely file locations for thumbnail images I hope to display
in a grid. Rather than having a grid be constructed row-to-row, I was
wondering if it is at all possible to dynamically construct this grid as a
table of thumbnails whereby each cell (perhaps 5-6 columns across)
represents one record? I have no idea how one would construct this loop that
spans columns AND rows rather than just rows.

Thanks for any ideas,

Dave
 
A

Adrienne

Hello folks,

I have an interesting problem and am looking for some advice. I am
hoping to build an asp whereby records are pulled from SQL Server.
These records will be merely file locations for thumbnail images I hope
to display in a grid. Rather than having a grid be constructed
row-to-row, I was wondering if it is at all possible to dynamically
construct this grid as a table of thumbnails whereby each cell (perhaps
5-6 columns across) represents one record? I have no idea how one would
construct this loop that spans columns AND rows rather than just rows.

Thanks for any ideas,

Dave
Do something like:

<% columns = 5 'how many columns do you want?%>
<table summary="thumbnail gallery">
<tbody>
<% 'get the records
'start a loop
counter = counter + 1
imgsrc = rs(fieldvalue)
desc = rs(description of image if there is one) %>
<td><img src="<%=imgsrc%>" alt="<%=desc%>"></td>
<% rs.Movenext
if columns mod counter = 0 then
%>
</tr>
<% if not rs.EOF then%>
<tr>
<% end if%>
<% end if %>
</tbody>
</table>
 
D

David Shorthouse

Adrienne,

It was a good start, but doesn't work. Any chance you can scrutinize your
code again. In particular, I don't know where to put the "loop". The result
of your code is one column of images instead of being spread across columns
and rows.

Thanks for any additional suggestions,

Dave
______________________________
Remove "_SPAM" to reply directly.
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top