Link to home
Start Free TrialLog in
Avatar of erikTsomik
erikTsomikFlag for United States of America

asked on

Help dynamically build the table in coldfusion

I have a list of courses,(which is dynamic rign now 2 courses but could be more). I Nedd to check the completion for that courses and output it into the HTML table. First i am trying to loop through the courses and get the completion, and then output it into the table

But unfortunately it did not work
 

lcourse is list of courses
<cfloop from="1" to="#ListLen(lcourse)#" index="i">
	<!---	<cfset qName="checkCompletion" &i>--->
			<cfquery name="qName" datasource="cfelsunrise" dbtype="ODBC">
				Select completiondate from EmployeeTraining where EmployeeID=#EmployeeID# and courseID in (#lcourse#)
			</cfquery>
 
	</cfloop>
	<cfloop from="1" to="#ListLEn(lcourse)#" index="i">
	<td align="center" width="2%" <cfif qName.completiondate is not "">bgcolor="##00FF00"<cfelse>bgcolor="##FF0000"</cfif>></td>
	
	</cfloop>
	</tr>
	
	</cfoutput>

Open in new window

Avatar of JillofallTradesMistressofNone
JillofallTradesMistressofNone
Flag of United States of America image

Hi.   Where is your opening cfcoutput tag?  Is it just not in this code sample?  Check out this page for help on cfloops and output:  http://www.quackit.com/coldfusion/tutorial/coldfusion_loops.cfm

Good luck!
ASKER CERTIFIED SOLUTION
Avatar of adobe116
adobe116

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial