jQuery in Action, 2nd edition*
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
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: 60781

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] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Problem setting bgcolor on a cell
Similar Threads
org.apache.jasper.JasperException: java.lang.NullPointerException
Fieldset is not working
Fieldset is not working
How many people share your name?
spaces while populating using s:iterator