Click to See Complete Forum and Search --> : Table border color


quantum
01-29-2004, 08:40 AM
I am writing a windows program (to run on the desktop) in vb.net that writes a report as an html file.
Now, I chose a nice soft grey for the table border, (bordercolor) so that the text will stand out. But when I print the page from IE6.0 with a setting not to print backgroud, the border comes out black. If on the other hand, I switch to printing backgrounds, then the border prints correctly.
I checked my page with Dreamweaver's validator and it tells me that bordercolor is not a valid attribute in current versions of html. I would like to know:
(1) Why does the border print incorrectly when IE set not to print backgrounds?
(2) What would be a good solution? (I don't remember what the default behavior is, but I imagine most people have their brousers set not to print backgrounds)
I'll appreciate your help

DaveSW
01-29-2004, 09:36 AM
Could you use a little css in the head of your page?

<style type="text/css"><!--
table {
border: 1px solid #0099ff;
}
--></style>

quantum
01-29-2004, 10:07 AM
I'll try that , Dave.
I hadn't thought about using CSS to manipulate table attributes. I already have a CSS file for my page, so I'll put the rule there.
I'll let you know how it went.
Thanks a lot,

DaveSW
01-29-2004, 10:12 AM
NP :D

Good luck.

quantum
01-29-2004, 06:47 PM
Well Dave, the CSS is changing the color of the border but not the rulers inside. When you use the bordercolor attribute in html, IE displays both the border and the inside grid in that color. I was looking for some CSS property that will let you change the color of the rulers but I didn't find any.
What do you think might be a solution to this?

ray326
01-29-2004, 09:23 PM
I don't know what you mean by "rulers inside" but is it the cell borders?

td { border: 1px solid #0099ff; }

You might also want to try

table { border-collapse: collapse; }

PeOfEo
01-29-2004, 09:39 PM
Or if you want some tables to be one color and others another and cells to have this attribute while others another
use
td.bluecell {
border-right:1px solid blue;
}
td.redcell {
border-left:1px solid red;
}
then
<td class="bluecell"></td>
<td class="redcell"></td>

quantum
01-29-2004, 09:49 PM
Yes, I meant the cell borders. Sorry for using a confusing word. As a matter of fact I hadn't realized I could manipulate the cell borders individually.
Thanks a lot guys for the advice.

PeOfEo
01-29-2004, 10:03 PM
no problem. A class can be used for more then one cell btw. So one column can have this bg color and another this one, or something. You are not limited to the border attribute obviously.

quantum
01-30-2004, 10:33 AM
Thanks PeOfEo.
By the way I was trying to figure out what your nickname means but I didn't find any good combination of words beginning with those two letters.
Well, I'll try to put into practice everything I learned from you today. I still have another problem to solve related to background printing, but I'll post that to a different thread.
Thanks again
-Alex-

PeOfEo
01-30-2004, 05:12 PM
No problem. http://www.w3schools.com/css/css_background.asp
my name is spanish for ugly fart btw ;)