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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a variable in a style statement

Status
Not open for further replies.

Papa Bear

Programmer
Feb 1, 2003
37
GB
Hi All

I have the following line in an ASP page
Code:
<tr><td style="text-align:center;font-size: xx-large;color:green"><%=CompanyRS("Company_Name")%></td></tr>
This prints the company name at the top of an invoice.

What I would like to do is replace the word 'Green' with <%=CompanyRS("Company_Colour") so the user can change the colour of the heading. I just can not work out the format. Can anybody help please.

Or is there a better way using a style sheet?

Steve
 
Sorry, I put this in the wrong thread. Should be in HTML
 
why can't you do it the same way you display the company name?

Code:
<tr><td style="text-align:center;font-size: xx-large;color:[COLOR=red]<%=CompanyRS("Company_Colour")%>[/color]"><%=CompanyRS("Company_Name")%></td></tr>


--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
That worked OK. Thanks
I actually tried that in my code, but because my editer did not high light the ASP delimiters as usual ie [COLOR=black yellow} <% %> [/color](I use Visual web developer 2010 express), I thought it was an error and did not run it. Ahhhh!
 
That worked OK. Thanks

Made an error in the above post. } should have been ]. Can I edit my own posts? this is what I sould have said.

I actually tried that in my code, but because my editer did not high light the ASP delimiters as usual ie [COLOR=black yellow] <% %> [/color](I use Visual web developer 2010 express), I thought it was an error and did not run it. Ahhhh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top