changing font color using response.write

the default font color of my asp page is "white" as set in the body tag

i want to change my table headers to "gold" and only the table headers and the rest of the text on the page to remain white.

I have come up with this but it will not change the color:

        Response.write "<font color=""" & gold & """>"
      Response.write "<center>"
      Response.write "<TABLE BORDER=1>"
      Response.write "<TR>"
      Response.write "<TH>User_name</TH>"
      Response.write "<TH>Last_log_date</TH>"
      Response.write "<TH>IP_Address</TH>"
      Response.write "<TH>Login_count</TH>"
      Response.write "</TR>"
        Response.write "</font>"

can someone help me please?
sh00tarAsked:
Who is Participating?
 
HuyBDCommented:
the FONT tag is not effected with table style, so try this

     Response.write "<center>"
     Response.write "<TABLE BORDER=1>"
     Response.write "<TR style=""color: gold"">"
     Response.write "<TH>User_name</TH>"
     Response.write "<TH>Last_log_date</TH>"
     Response.write "<TH>IP_Address</TH>"
     Response.write "<TH>Login_count</TH>"
     Response.write "</TR>"
....
0
 
Ivo StoykovCommented:
Hello sh00tar,

try this

<TABLE BORDER=1>
  <thead>
    <TR style="COLOR: <%=gold%>">
      <TH>User_name</TH>
      <TH>Last_log_date</TH>
      <TH>IP_Address</TH>
      <TH>Login_count</TH>
    </TR>
  </thead>
  <tbody>
...
...
  </tbody>
</TABLE>


HTH

I
0
 
sh00tarAuthor Commented:
gold is not a variable for me and I need to write the html inside the response.write
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
sh00tarAuthor Commented:
i don't quite know how to use the brackets properly, almost always gives me an error when I try to use complex quotations in script
0
 
Ivo StoykovCommented:
Hi sh00tar,

<TABLE BORDER=1>
  <thead>
    <TR style="COLOR: golà">
      <TH>User_name</TH>
      <TH>Last_log_date</TH>
      <TH>IP_Address</TH>
      <TH>Login_count</TH>
    </TR>
  </thead>
  <tbody>
...
...
  </tbody>
</TABLE>


regards

I
0
 
sh00tarAuthor Commented:
thankyou HuyBD, your suggestion works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.