cftable

Builds a table in a CFML page. This tag renders data as preformatted text, or, with the HTMLTable attribute, in an HTML table. If you do not want to write HTML table tag code, or if your data can be presented as preformatted text, use this tag. Preformatted text (defined in HTML with the <pre> and </pre> tags) displays text in a fixed-width font. It displays white space and line breaks exactly as they are written within the pre tags. For more information, see an HTML reference guide.

To define table column and row characteristics, use the cfcol tag within this tag.

  <cftable query="">

 cftable(query="");

The cftable tag is DEPRECATED as of ColdFusion 2016

Discouraged: The use of tags that generate client side UI code is generally discouraged by the CFML community. See: http://static.raymondcamden.com/cfuitherightway/cftable/index.html

Attribute Reference

query query
Required

Name of cfquery from which to draw data.

maxrows numeric

Maximum number of rows to display in the table.

colSpacing numeric

Number of spaces between columns

headerLines numeric

Number of lines to use for table header (the default leaves
one line between header and first row of table).

htmltable any

Renders data in an HTML 3.0 table.

If you use this attribute (regardless of its value),
CFML renders data in an HTML table.

border any

Displays border around table.

If you use this attribute (regardless of its value),
CFML displays a border around the table.

Use this only if you use the HTMLTable attribute.

colheaders any

Displays column heads. If you use this attribute, you must
also use the cfcol tag header attribute to define them.

If you use this attribute (regardless of its value),
CFML displays column heads.

startrow numeric

The query result row to put in the first table row.

Compatibility

ColdFusion:

DEPRECATED since version 2016

Links more information about cftable

Examples
Sample code using the cftable tag

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub