I'm new here so forgive me for all the formatting errors. I'm trying all the help topics...
Using coldfusion, I'm trying to display all columns in a table heading except for 2 of them. They all show up. I'm not sure what I'm doing wrong.
<cfloop list="#ArrayToList(getTableDataHeading.getColumnNames())#"index="col" >
<cfif "#col#" NEQ "itemID" or "#col#" NEQ "locationID">
<th>#col#</th>
</cfif>
</cfloop>
You are using wrong condition in your cfif statement. You need AND condition and not the OR condition. Learn how operators work here.
<cfoutput>
<cfloop list="#ArrayToList(getTableDataHeading.getColumnNames())#"index="col" >
<cfif col NEQ "itemID" AND col NEQ "locationID">
<th>#col#</th>
</cfif>
</cfloop>
</cfoutput>
You should also try to avoid unnecessary use of # sign. Check out the difference between your cfif statement and mine regarding the use of # sign.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With