home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfcol.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.2 KB  |  43 lines

  1. <!--- This example shows the use of CFCOL and CFTABLE
  2. to align information returned from a query --->
  3.  
  4. <!--- this query selects employee information from the
  5. snippets datasource --->
  6. <CFQUERY NAME="GetEmployees" DATASOURCE="cfsnippets">
  7. SELECT      Emp_ID, FirstName, LastName, EMail, Phone, Department
  8. FROM         Employees
  9. </CFQUERY>
  10.  
  11. <HTML>
  12. <HEAD>
  13. <TITLE>CFCOL Example</TITLE>
  14. </HEAD>
  15.  
  16. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  17. <BODY  bgcolor="#FFFFD5">
  18.  
  19. <H3>CFCOL Example</H3>
  20.  
  21. <!--- Note the use of the HTMLTABLE attribute to display the
  22. CFTABLE as an HTML table, rather simply as PRE formatted information --->
  23. <CFTABLE QUERY="GetEmployees" STARTROW="1" COLSPACING="3" HTMLTABLE COLHEADERS>
  24. <!--- each CFCOL tag sets the width of a column in the table,
  25. as well as specifying the header information and the text/CFML
  26. with which to fill the cell --->
  27.     <CFCOL HEADER = "<B>ID</B>"
  28.         ALIGN = "Left"
  29.         WIDTH = 2
  30.         TEXT  = "#Emp_ID#">
  31.     <CFCOL HEADER = "<B>Name/Email</B>"    
  32.         ALIGN = "Left"
  33.         WIDTH = 15
  34.         TEXT  = "<a href='mailto:#Email#'>#FirstName# #LastName#</A>">
  35.     <CFCOL HEADER = "<B>Phone Number</B>"
  36.         ALIGN = "Center"
  37.         WIDTH = 15
  38.         TEXT  = "#Phone#">
  39. </CFTABLE>
  40.  
  41. </BODY>
  42. </HTML>       
  43.