Cant you just use the CurrentRow variable, for the record number display?

Jason Lees
Systems Developer
National Express Coaches Ltd.



-----Original Message-----
From: Ian Vaughan [mailto:[EMAIL PROTECTED]]
Sent: 27 November 2002 16:39
To: CF-Talk
Subject: Alternating Row Colours & Number Listing in CFOutput


Hi

I am using the following script to display the latest 5 records from the
database table, and alternate the colour of each row, from white to grey.

This works, but how to I add a number listing with each record so the latest
record would have a number 1. next to it the seconf record would have number
2 then number 3 etc.

If you look at the code attached and the second CFIF statement you will see
that at present I have hard coded a number 1 and number 2, so in the results
at present it is bringing back

1.) Record Name
2.) Record Name
1.) Record Name
2.) Record Name
1.) Record Name

How to I make this dynamic in Coldfusion so it is a number listing of 1 to
5???

TIA
Ian

<cfoutput query="latestlinks">

      <tr>

       <CFIF (CurrentRow MOD 2) IS 1>

        <td width="2%" align="center" class="sideblue" valign="middle">
          <img border="0" src="height.gif" width="1" height="14"></td>

       <cfelse>
         <td width="2%" align="center" class="sideblue" bgcolor="##DFDFDF">
        <img border="0" src="height.gif" width="1" height="14"></td>

          </cfif>

        <CFIF (CurrentRow MOD 2) IS 1>
        <td width="8%" align="left" class="sideblue" valign="middle">1.</td>
          <cfelse>
          <td width="8%" align="left" class="sideblue"
bgcolor="##DFDFDF">2</td>
          </cfif>

          <CFIF (CurrentRow MOD 2) IS 1>

        <td width="90%" valign="middle"> <a href="#linkurl#"
class="xmaslinking">#linktitle#</a></td>
          <cfelse>
          <td width="90%" bgcolor="##DFDFDF"><a href="#linkurl#"
class="xmaslinking">#linktitle#</a></td>
          </cfif>
      </tr>

      </cfoutput>





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to