Solved

output query - alternating table cells

Posted on 2003-12-10
6
169 Views
Last Modified: 2013-12-24
my output query:

<cfoutput query="drs"><tr>
               
            <td width="7%" valign="top"><a href="detail2.cfm?DrID=#drs.DrID#"><img src="../images/doctors/thumbs/#drs.thumb#" alt="Dr.#drs.LastName#" border="0"></a></td>
            <td width="93%" valign="top">
<p><a href="detail2.cfm?DrID=#drs.DrID#">#FirstName# #MI# #LastName# #Type#</a>
<br>#Blurb#</p> </td>
  </tr></cfoutput>

this is the way it looks now:
http://rothmaninstitute.com/ourdoctors/index.cfm

this is how i want it to look:
http://scoi.com/doctors/index.html
0
Comment
Question by:phillystyle123
  • 4
6 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9914931
<cfoutput query="drs"><tr>
               <cfif drs.currentRow /2>
               <td width="10%"></td>
               </cfif>
            <td width="7%" valign="top"><a href="detail2.cfm?DrID=#drs.DrID#"><img src="../images/doctors/thumbs/#drs.thumb#" alt="Dr.#drs.LastName#" border="0"></a></td>
            <td width="93%" valign="top">
<p><a href="detail2.cfm?DrID=#drs.DrID#">#FirstName# #MI# #LastName# #Type#</a>
<br>#Blurb#</p> </td>
  </tr></cfoutput>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9914942
and change this

<td width="93%" valign="top">

to this
<td width="83%" valign="top">
0
 

Author Comment

by:phillystyle123
ID: 9915040
almost there! this is what i'm getting using your code:

http://rothmaninstitute.com/ourdoctors/index2.cfm
0
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.

 
LVL 25

Expert Comment

by:James Rodgers
ID: 9915124
<cfoutput query="drs"><tr>
               <cfif drs.currentRow /2>
               <td width="10%"></td>
               </cfif>
            <td width="7%" valign="top"><a href="detail2.cfm?DrID=#drs.DrID#"><img src="../images/doctors/thumbs/#drs.thumb#" alt="Dr.#drs.LastName#" border="0"></a></td>
            <td width="83%" valign="top">
<p><a href="detail2.cfm?DrID=#drs.DrID#">#FirstName# #MI# #LastName# #Type#</a>
<br>#Blurb#</p> </td>
<cfif NOT drs.currentRow /2>
               <td width="10%"></td>
               </cfif>

  </tr></cfoutput>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9915131
it looks like it is appearing on every row try mod instead of /
0
 
LVL 15

Accepted Solution

by:
danrosenthal earned 75 total points
ID: 9915181
Try this...

<cfoutput query="drs">
      <tr>
            <CFIF currentrow MOD 2 eq 0>
            <td></td>
            </cfif>
            <td valign="top"><a href="detail2.cfm?DrID=#drs.DrID#"><img src="../images/doctors/thumbs/#drs.thumb#" alt="Dr.#drs.LastName#" border="0"></a></td>
            <td valign="top" <CFIF currentrow MOD 2 neq 0>colspan="2"</cfif>><p><a href="detail2.cfm?DrID=#drs.DrID#">#FirstName# #MI# #LastName# #Type#</a><br>#Blurb#</p></td>
      </tr>
</cfoutput>
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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 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