Just a comment

Nice... but it will cause improper HTML if the query results are evenly
divisible by the var your're using to Mod with.... Here's the results of a
table generated with this forumula... notice the extra </tr><tr> combo.  If
you needed to display these results in netscape.... well, I don't have
netscape on my computer anymore to check, but we all know how picky she is.

<table border="1"> 
        <tr>     
                <td>Carolynn</td>                
                <td>Dave</td>
                <td>Linda</td>
                <td>Aaron</td>
                        </tr> <tr> 
        </tr> 
</table> 

I remember having to do something similar myself, and I think I got it to
work and still generate proper html... but it was a mess. Worse I can't
remember how I did it now to whip out for comparison.

|-----Original Message-----
|From: Nathan Stanford [mailto:[EMAIL PROTECTED]]
|Sent: Friday, March 16, 2001 3:09 PM
|To: CF-Talk
|Subject: RE: Formatting CFQUERY Results in a Table
|
|
|
|
|
|This can be found on my website in Issue 00001
|
|I. ColdFusion Code: Output Text in 2,3,4,... Rows 
|You can just modify the number 4 after the MOD 
|and change the yourquery to whatever you query name 
|is and of course the var to your own var. 
|
|<table> 
|       <tr> 
|       <cfoutput query="yourquery"> 
|               <td>#var#</td>
|               <cfif yourquery.CurrentRow MOD 4 IS 0> 
|                       </tr> <tr> 
|               </cfif> 
|       </cfoutput> 
|       </tr> 
|</table> 
|
|
|
|
|
|> -----Original Message-----
|> From:        James Birchler [SMTP:[EMAIL PROTECTED]]
|> Sent:        Friday, March 16, 2001 1:27 PM
|> To:  CF-Talk
|> Subject:     Formatting CFQUERY Results in a Table
|> 
|> Hi Gang -
|> 
|> I'm building an employee directory, and am adding a page 
|that displays all
|> employee photos so that if you don't know someone's name, 
|you can find it
|> by
|> recognizing their face. My query pulls an image url and 
|fname/lastname
|> from
|> a database.
|> 
|> I'm trying to format the output in table rows, with each row 
|containing 4
|> table cells (each with one photo displayed).
|> 
|> How do I let CF know when to create another table row? So 
|far I can make
|> one
|> really long row, or one really long column!
|> 
|> Is the answer on the SQL side (using LIMIT or COUNT) or on 
|the CF side, or
|> both? Any suggestions much appreciated.
|> 
|> Thanks,
|> 
|> James
|> 
|> 
|>
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to