Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Output a dynamic layout

Posted on 2001-06-12
5
Medium Priority
?
141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 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