Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BGCOLOR in <TD> Tag Spoils My Script

Status
Not open for further replies.

Chinyere

Programmer
Mar 9, 2001
79
0
0
US
Hello,

I am using ColdFusion Studio to edit a CF page so I wanted to change the color of a table cell background one day...

I innocently typed in something like <TD bgcolor=&quot;#3DA768&quot;>...

When I test the script, lo and behold, I receive an error message that goes something like this:
___________________
ERROR!

CF was looking for &quot;

The last line processed was (54:40)...
______________________

What is up with THAT?

When I take out the hex color, it works like a charm. Huh? Does anyone out there have any idea why this is happening? It would be great to receive an answer soon.

Chinyere [afro]

PS I made up the hex color above [bigsmile]; I am not sure that it exists...
 
If that tag is inside of cfoutput tags, you'll have to escape the pound sign. Try using

Code:
<td bgcolor=&quot;##3DA768&quot;>
John Hoarty
jhoarty@quickestore.com
 
CF can't read a single '#'. You need to either eliminate the '#' or add two of them like this. <td bgcolor=&quot;##FFFFFF&quot;>. Hope this helps or if I mis-read your message.

-Bamboo
 
Thanks guys!

That was ultraquick! Can't believe it!

May I throw in another quick question (or maybe I should start a new thread...)

I tried to center an image inside a table and it wouldn't take (the program ignored it).

As you all mentioned above, again this table was nested inside CF tags.

Any tips?

Chinyere [afro]

PS Please bear with me, I am a newbie CF developer [bigsmile].
 
are you doing this for the cell ?

<td bgcolor=&quot;##FFFFFF&quot; align=&quot;center&quot;>


 
Keep in mind though, that you only need to escape the # with
double #'s if its inside a CFOUTPUT section. I got burned by
that once. ;)

MG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top