On Tue, 15 Feb 2005 12:23:30 -0600, Vam <ie@explorem.com> wrote:
The way we've figured around this is to add a small colored bitmap to
the color cells instead of using their background color property. But
the problem with that is finding the correct size of the bitmap, and the
correct positioning. anybody have any idea how I could get the pixel
size of a cell in an HTML table? And the position that I would need to
place a bitmap so that it covers that cell? Or is there a better way of
getting
around this color problem in general, so that it'll always print no
matter what the IE option settings?
Why IE? The vast amount of browsers out there need to be served, not just
IE.
Anyway, have you considered creating a separate stylesheet for printing so
no background color is needed? Just create a print stylesheet and add it
to your pages through a link element in the head of your document with
appropriate styles.
<link rel="stylesheet" type="text/css" media="print"
href="http://www.foo.invalid/bar/styles/print.css">
If you insist on using that background image, with which you do nobody a
favour really, you don't need to know anything about the dimensions of the
cell it is needed for. Create a tiny image with the correct color, like
4*4px or something like that. Then use some simple style for the
background of your table cells:
table.colored img, .colored th img, .colored td img {
width:100%;
height:100%; }
Any table that has class="colored" added to it, will have any image in its
cells streched to be 100% of both the height and the width of the cell,
regardless its dimensions.
Not tested.
--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog |
http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp |
http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen |
http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'