Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes HTML, CSS and JavaScript and the fly likes Problem setting bgcolor on a cell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem setting bgcolor on a cell " Watch "Problem setting bgcolor on a cell " New topic

Problem setting bgcolor on a cell

Graham Jessiman

Joined: Jun 13, 2013
Posts: 1
The following code snippet shows a font background color set, along with trying to set the cell background to the same color.

<td align="center" bgColor="#639400">
<span class="eocfield">
<font style="background-color:#639400;">
Open </font>

Attached is what is displayed.... is there a priority hierarchy to the settings?


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

Both bgcolor and the font tag are long-since deprecated; why are they being used? Is this some legacy code from a decade or so ago?

If this is new code, it should be using CSS, not deprecated tags and attributes.

Setting background-color on the <td> element will surely have the effect that you seek.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Problem setting bgcolor on a cell
It's not a secret anymore!