?
Solved

Output a dynamic layout

Posted on 2001-06-12
5
Medium Priority
?
144 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 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

864 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