bgcolor not working for a table in Netscape and Firefox but ok in IE and Safari -

Posted on 2006-11-14
Last Modified: 2012-06-22
Hi there
not sure if this is an HTML issue or CSS but some browsers are showing the bgcolor and others not

Question by:abraxar
  • 3
  • 2
LVL 30

Expert Comment

ID: 17941635
Greetings Maria,

My first guess is that it is because bgcolor is deprecated... you should be using background-color


Author Comment

ID: 17941845
thanks that sounds good, I've had a quick look but am not sure of the best way to use that for a table and on some of the pages just for a table row. If I use the stylesheet to define the table then all the tables will change color, but I only want one to change.
sorry if my questions are very basic!
LVL 30

Expert Comment

ID: 17942366
You need to use style,

either inline
<table style="background-color:#336699"> or in your row <tr style="background-color:#336699">

or in the <head> of each page
<style type="text/css">
#myTable {
<table id="myTable">etc</table>

or in your stylesheet

#myTable {

where you give id="myTable" to the table in question. You can use the same method for a row or any element on the page. ID's are unique though. If you want to target more than one tag on the same page, you should use class. <table class="myTable"> and .myTable {style} in the stylesheet or head.

Hope this helps
LVL 30

Accepted Solution

Steggs earned 125 total points
ID: 17942374
oops i forgot to close the styles:

}                                        ^     always close with ;  

Author Comment

ID: 17946321
that's great- all done! Many thanks

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Browser history files 3 60
How can i modify my File download link ? 6 65
FireFox Add-on Plugins 4 39
Google Chrome icon file. 3 42
It's here again; Microsoft is launching a new version of Internet Explorer: Internet Explorer 9, with noticeable changes on its interface, functions and new tools. As they say on its promotional video: "It's time to play, on a more beautiful web", f…
Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question