Link to home
Create AccountLog in
Avatar of sh00tar
sh00tar

asked on

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?
Avatar of Ivo Stoykov
Ivo Stoykov
Flag of Bulgaria image

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
Avatar of sh00tar
sh00tar

ASKER

gold is not a variable for me and I need to write the html inside the response.write
Avatar of sh00tar

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of HuyBD
HuyBD
Flag of Viet Nam image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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
Avatar of sh00tar

ASKER

thankyou HuyBD, your suggestion works.