Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / July 2006



Tip: Looking for answers? Try searching our database.

Making a row colored in a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jamie61880 - 27 Jul 2006 19:58 GMT
Hi,
I have some tables that get displayed when someone does a search
for a company for instance. In this table, it shows the company name,
the contact, address, company classification, etc. The company
classification field is just a way to tell us if the company is a key
account or not. They are labeled as an "A" if they are. What I would
like to do is to make the rows that have the company classification
labeled as an "A" to be a yellow color so users can tell if the
company is a key account right away or not. Does anyone know how to
get this to work correctly? I have attached only a little code. I
think this is where I will have to update it at. Can anyone help me?
Thanks.

Andy

<CFOUTPUT QUERY="CompanySearch" MaxRows="#MaxRows#"
Startrow="#Start#">

<tr>
<td>
<cfif Company Is Not "">
<a href="edit_contact.cfm?ContactID=#ContactID#">#Company#</a>
<cfelse>&nbsp; </cfif>
</td>

<td>
<cfif Company_Classification is not "">
#Company_Classification#
<cfelse>
&nbsp; </cfif>
</td>

</tr>
</CFOUTPUT>
jdeline - 27 Jul 2006 20:56 GMT
In the  your <tr> tag, check to see if Company_Classification is "A".  If it
is, add BGCOLOR="yellow" to the tag.  See below.

<CFOUTPUT QUERY="CompanySearch" MaxRows="#MaxRows#"
Startrow="#Start#">

<tr <CFIF Company_Classification IS "A">BGCOLOR="yellow"</CFIF>>
<td>
<cfif Company Is Not "">
<a href="edit_contact.cfm?ContactID=#ContactID#">#Company#</a>
<cfelse>&nbsp; </cfif>
</td>

<td>
<cfif Company_Classification is not "">
#Company_Classification#
<cfelse>
&nbsp; </cfif>
</td>

</tr>
</CFOUTPUT>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.