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

How To Color Cell Text 1

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi,

Another easy one, I'm sure.

I want to specify a color for the text in a certain cell.

In the TD tag, I tried TEXT="#FF0000" but it doesnt work.

I want to colot the text, not the cell background.

Thanks, John
 
Well there's a couple of ways but if you want to put the style in the td tag you would use;
Code:
<td [COLOR=red]style = &quot;color:red&quot;[/color]>content</td>
Or if you want to use a style in the head and a class for the td then you would do something like this;
Code:
<head>
[COLOR=red]<Style>
td.test {color:red}
</style>[/color]
</head>
<td [COLOR=red]class = &quot;test&quot;[/color]>
Hope this helpls

Glen
 
Thanks glenmac,

I'll go with the style/class combination because I need it to be reusable on several pages.
John
 
If you need it on several pages it's best to use a style sheet. Put all your styles in a file and save it as a css file ie. style.css in the same directory as your pages then link to it in your pages.
Code:
<head>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;>
</head>

the style sheet style.css would have ;
Code:
td.test {color:red}
Thanks for the star. Hope this helps.

Glen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top