Solved

Output a dynamic layout

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

13 Experts available now in Live!

Get 1:1 Help Now