This week's giveaway is in the Groovy forum.
We're giving away four copies of Groovy Fundamentals video training course and have Ken Kousen on-line!
See this thread for details.
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 Groovy Fundamentals video training course this week in the Groovy 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
Author

Problem setting bgcolor on a cell

Graham Jessiman
Greenhorn

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>
 </span>
</td>

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



[Capture.JPG]

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62827
    
  68

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