Solved

Output a dynamic layout

Posted on 2001-06-12
5
130 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now