Hi, let's assume that there is no query for the CFOUTPUT tag. Which would be
better coding style?
I've seen it done both ways: CFOUTPUTing each variable and
CFOUTPUTing/encapsulating the entire
template. Sometimes when I run into things I think "what do the pros do?".

What would the pros do in this situation?

Josh

-----Original Message-----
From: Katherine Maltby [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 29, 2001 10:00 AM
To: CF-Talk
Subject: RE: Correctly using CFOUTPUT


It depends how you want the results to be displayed, but I'd recommend
putting the cfoutput tags inside the table before the <tr> as otherwise
you'll open a new table for each line of results, which isn't good if you're
pulling rows and rows back from a database.

Kath

Web Production Director

----------------------
United Kingdom
http://www.thoughtbubble.co.uk/
Ph: +44 (0) 20 7387 8890
----------------------
New Zealand
http://www.thoughtbubble.co.nz/
Ph: +64 (0) 9 488 9131

The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s) . Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0) 20 7387 8890



-----Original Message-----
From: J Winter [mailto:[EMAIL PROTECTED]]
Sent: 29 May 2001 14:48
To: CF-Talk
Subject: Correctly using CFOUTPUT


Hi, I've always been curious about this. What is the correct way? Does it
matter?

Listing 1:

<CFOUTPUT>
<TABLE>
        <TR>
                <TD>#var1#</TD>
        </TR>
        <TR>
                <TD>#var2#</TD>
        </TR>
</TABLE>
</CFOUTPUT>

Listing 2:

<TABLE>
        <TR>
                <TD><CFOUTPUT>#var1#</CFOUTPUT></TD>
        </TR>
        <TR>
                <TD><CFOUTPUT>#var2#</CFOUTPUT></TD>
        </TR>
</TABLE>

Is there an unwritten rule; if there are more than 4 (or ?) vars in a page
Listing 1 is a good way to do it else Listing 2 is recommended? I'm assuming
when using <CFOUTPUT QUERY="q1"></CFOUTPUT> Listing 1 would always be
applicable.

Thanks for any help!

Josh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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