Click to See Complete Forum and Search --> : [RESOLVED] Cell background colors wont change


drennan
07-07-2008, 10:36 AM
I'm working on a table and cant change the background color of individual cells. I have been given some code to help with the functionality of the table and am unsure whether this is having some control over the formatting settings applied within DW (like CSS maybe). I'm fairly new to this btw. Basically, I can select the whole table and change the border colors (not BG color tho) and if i try and change the cell background colour in the properties inspector, nothing happens. i've got round this by setting a tiled colored pixel as the background image of individual cells but this is REALLY slowing down DW for some reason and making it impossible to work on the project. Any ideas on why I can't change the BG color? Thanks, Dren.

eCat
07-07-2008, 11:48 AM
Well, you don't show your code but your td tag would look like this:

<td bgcolor="#000000">&nbsp;</td>

Also, make sure your <table> and <tr> tags don't have conflicting background colors.

Remember to check browser support with Dreamweaver's error checking function.

eCat

drennan
07-07-2008, 12:36 PM
Thanks. I've uploaded what i've done so far to http://members.lycos.co.uk/drennanuk/forums.html

It would be really helpful if you could see why I can't change the BG colors. As you can see, i'm tiling coloured pixels eveywhere and this is slowing DW right down. Thanks

natobasso
07-07-2008, 12:42 PM
You can create a css class in your css doc for each cell of your table. I create a "tabletitle" and "tablesubtitle" to control those rows of my tables.

Use table class="tabletitle" to determine row style in your <td> tag, for example, for a particular row within a <tr>.

Make sure you don't have "style" filled in in DW. This will override the table class class as it were and def get rid of the background image for your table color. Increases load time as you said.

eCat
07-07-2008, 12:50 PM
The colors look good to me... various shades of green, blue, pink & purple.

What exactly isn't working for you?

drennan
07-07-2008, 12:58 PM
i've got those colors there by setting the background image of each cell to tile a colored pixel. Ever since I did this, dreamweaver has slowed right down to the point of being unusable. Almost like its having to render the tiled pixels as I move around the page. I want to be able to select individual cells and change their background color and border color from the properties inspector without having to use tiled images.

eCat
07-07-2008, 01:02 PM
Wow... well, I just looked at your code and it would appear that you have a few things going on.

1. You have defined a partial background color in the style for rows and cells in your CSS:

th, td {
border-color:#333;
background-color:#CCC;
font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; }

2. You have a background image for each cell AND a background color: <td width="196" background="orange_light.jpg" bgcolor="#FFFFFF" class="leftAlign" scope="row">&nbsp;</td> These are definitely going to conflict with each other - the image color will overwrite any color you have selected for the background of a cell.

There was one more thing too... but now I can't find it.

eCat
07-07-2008, 01:06 PM
Ok - I would suggest creating the color with the bgcolor attribute of your rows & cells rather than using an image. The image will overwrite your bgcolor selection and it will not only slow dreamweaver down, but will take a heck of a long time to load in a browser once it is live. Not to mention what would happen if someone has their images turned off!

Just go through your page and pull out all instances of the background image in your cells. Then go through and select rows or cells and add the background color to each as you go.

drennan
07-07-2008, 01:26 PM
Thanks :) I know there is a lot going on! I'm still learning and have been messing around trying to get this to work. The reason I set a tiled background image in the first place is because DW was not allowing me to change the color of the cell background or border from the properties inspector. I have removed all the tiled images and uploaded again but DW isn't allowing me to set the colors still. Nothing is happening even though the selected color is appearing in the properties inspector. Have I got a governing color scheme setup (like CSS or something) which is stopping this from happening? Please look at the code now i've removed the images. Thanks :)

I just created a new html doc in DW and added a table and the BG colors change when I set them in property inspector, so its definitely something to do with that particular doc, not dreamweaver.

natobasso
07-07-2008, 01:29 PM
You are defining your table colors in too many ways. Limit it to just one and you're there. I'd use the css file myself, then apply those classes to your table.

drennan
07-07-2008, 01:34 PM
You are defining your table colors in too many ways. Limit it to just one and you're there. I'd use the css file myself, then apply those classes to your table.

Thanks. I'm not too sure how to do what you suggested in your previous post but will try and figure it out.

natobasso
07-07-2008, 01:35 PM
Well, as eCat pointed out you already have the td class called out in your css file. Just remove any background colors from your table html code and you'll see your css style start taking over instead.

drennan
07-07-2008, 01:41 PM
Its working! I removed the CSS colors and now i can change the colors from the property inspector. I thought it might be CSS governing the color scheme but I don't really know anything about CSS. Thank you for all your help guys, Dren.

natobasso
07-07-2008, 01:49 PM
Okay, step AWAY from the color inspector and use your css instead. You're not listening very well... :\

eCat
07-07-2008, 01:57 PM
For someone who is unfamiliar with CSS (as drennan claims to be) it can be a steep learing curve if this site has to go live soon.

But for the future drennan, you may want to brush up on some CSS skills! It is considered best practice to separate your content from your presentation.

eCat