Solved

Output a dynamic layout

Posted on 2001-06-12
5
132 Views
Last Modified: 2013-12-24
My query outputs 3 across and 2 down with a next 6 underneath etc. I would like to add a few borders to the table cells. Much like corbis.com. I am snagged because the cells repeat so a style on one will repeat itself and I want to ad individual styles to each cell (6 of them)
I don't think I have explained this too well but this link will clear it up:
http://store.corbis.com/search/productsearch.asp?sc=&search=soccer+ball&hidKeywordSearch=&hidSearchCategory=1&pf=DIGPIC&navid=create%2Fdigitalpictures%2Fphotography&hidIsNewSearch=TRUE
0
Comment
Question by:TheFish23
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:CF_Spike
ID: 6181796
Can you post the code for what you have done so far. It's a bit hard to visualize where the problem is.

Spike
0
 

Author Comment

by:TheFish23
ID: 6181885
<table width="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
  <CFOUTPUT query="mavroslist" startrow="#start#" maxrows="#display#">
<CFIF (CurrentRow MOD 3) IS 1>
</TR>
<TR valign="baseline">
</CFIF>
               
<TD class="thumb1">
<div align="center">
#trim(item)#
<br>


<img src="#config.ImagePathURL#/small/#imagethumb#" border="0"></a></div>

</cfoutput>
</td>

</TR>
</TABLE>
0
 
LVL 4

Accepted Solution

by:
CF_Spike earned 100 total points
ID: 6181984
ok, so you want to apply a different style definition to each table cell, Right?

How about you create a counter which counts for each iteration of the loop in the query. Use that semaphore to dynamically create a named class and create the style definition to apply to each of the classes.

<table width="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
<CFOUTPUT query="mavroslist" startrow="#start#" maxrows="#display#">
<CFIF (CurrentRow MOD 3) IS 1>
</TR>
<TR valign="baseline">
</CFIF>

<CFPARAM NAME="counter" DEFAULT="1">

<TD class="thumb#counter#">
<div align="center">
#trim(item)#
<br>


<img src="#config.ImagePathURL#/small/#imagethumb#" border="0"></a></div>
<CFSET counter = Counter + 1>

<CFIF Counter GT 6>
     <CFSET Counter = 0>
</CFIF>

</cfoutput>
</td>

</TR>
</TABLE>

Spike
0
 

Author Comment

by:TheFish23
ID: 6182055
That looks like the one, thanks Spike, I have to go now but will try it tomorrow and accept the comment.
thanks again
 
0
 

Author Comment

by:TheFish23
ID: 6189698
Spot on CF_Spike,
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question