CFCOL

Defines table column header, width, alignment, and text. Always used inside <CFTABLE> and </CFTABLE>.

CFCOL
Attribute

Description

HEADER

The text to use for the column's header.

WIDTH

The width of the column in characters (the default is 20). If the length of the data displayed exceeds the width value, the data is truncated to fit.

ALIGN

Column alignment (LEFT, RIGHT, or CENTER).

TEXT

Double-quote delimited text that determines what displays in the column. The rules for the text attribute are identical to the rules for CFOUTPUT sections, meaning that it can consist of a combination of literal text, HTML tags, and query result set field references. This means you can embed hyperlinks, image references, and even input widgets within table columns.

Example

<CFTABLE QUERY="GetMonthlyEvents" MAXROWS=10 >
   <CFCOL HEADER="<B>Event</B>" WIDTH=24 TEXT="#EventName#">
   <CFCOL HEADER="<B>Time</B>" WIDTH=7 ALIGN=CENTER TEXT="#StartTime#">
   <CFCOL HEADER="<B>Ticket</B>" WIDTH=6 ALIGN=CENTER TEXT="$#CostPerPerson#">
   <CFCOL HEADER="<B>Description</B>" WIDTH=100 ALIGN=LEFT TEXT="#EventDescription#">
</CFTABLE>