Creating Output Tables with <CFTABLE>

<CFTABLE> is unique among the CFML tags we've covered thus far in that it works as a replacement to the <CFOUTPUT> tag, rather than within it.

<CFTABLE> has two modes—one mode that displays data as plain text, organized in tabular fashion, and another mode that actually creates HTML 3.0 tables on-the-fly as it displays data. The first mode is used when you want to ensure compatibility with all browsers; the second is used when you need a little more control over table features.

<CFTABLE> in Text Mode

By default, <CFTABLE> creates output tables in text mode using HTML's <PRE> tag to insert white space between columns. I'll use my previous 8-track database to illustrate. My template page is illustrated in ...

Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.