return recordset of images in specific cells in a table

Discussion in 'ASP General' started by David Shorthouse, Jun 27, 2005.

  1. 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

    --
    ______________________________
    Remove "_SPAM" to reply directly.
     
    David Shorthouse, Jun 27, 2005
    #1
    1. Advertising

  2. David Shorthouse

    Adrienne Guest

    Gazing into my crystal ball I observed "David Shorthouse"
    <davidshorthouse@shaw_SPAM.ca> writing in
    news::

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

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Jun 28, 2005
    #2
    1. Advertising

  3. Thanks! I'll give it a go.

    Dave

    --
    ______________________________
    Remove "_SPAM" to reply directly.

    >
    >> 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>
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
     
    David Shorthouse, Jun 29, 2005
    #3
  4. 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.
    "Adrienne" <> wrote in message
    news:Xns9683640B75525arbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "David Shorthouse"
    > <davidshorthouse@shaw_SPAM.ca> writing in
    > news::
    >
    >> 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>
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
     
    David Shorthouse, Jun 30, 2005
    #4
  5. Adrienne,

    Got it all fixed-up and works a treat now.

    Dave

    --
    ______________________________
    Remove "_SPAM" to reply directly.
    "Adrienne" <> wrote in message
    news:Xns9683640B75525arbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "David Shorthouse"
    > <davidshorthouse@shaw_SPAM.ca> writing in
    > news::
    >
    >> 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>
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
     
    David Shorthouse, Jul 1, 2005
    #5
  6. David Shorthouse

    Adrienne Guest

    Gazing into my crystal ball I observed "David Shorthouse"
    <davidshorthouse@shaw_SPAM.ca> writing in news:eZ#MnRefFHA.1148
    @TK2MSFTNGP12.phx.gbl:

    > Adrienne,
    >
    > Got it all fixed-up and works a treat now.
    >
    > Dave
    >


    Glad I was able to help. It works for printing labels, too.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Jul 1, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Gilbert
    Replies:
    0
    Views:
    915
    Carl Gilbert
    Jul 20, 2005
  2. MrC

    Images in Table Cells

    MrC, Oct 5, 2004, in forum: HTML
    Replies:
    3
    Views:
    837
    Dan Abrey
    Oct 6, 2004
  3. jcnews at earthlink.net

    PROBLEM: Images have spaces between table cells

    jcnews at earthlink.net, Nov 25, 2004, in forum: HTML
    Replies:
    3
    Views:
    1,319
    Duende
    Nov 25, 2004
  4. Hung Huynh
    Replies:
    8
    Views:
    311
    Bob Barrows
    Sep 24, 2003
  5. Replies:
    11
    Views:
    1,336
    dorayme
    Apr 15, 2012
Loading...

Share This Page