Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a table with colored cells.

Status
Not open for further replies.

st3ph3n

Programmer
Sep 18, 2004
15
0
0
GB
Hey,

I have an ASP page that generates a table showing activity of a security van during the day. If it was at a particular location at a particular time then the cell corresponding to that location and time will be filled in.

To do this I simple give the TD a class of "1", which relates to ".1{ background-color:000000;}" in my style sheet.

When I print this the entire table is blank of course. Is there a way to define in CSS or otherwise that I need the table background colours printed out.

I don't want people to have to keep going to IE's printing options every time to reset the background printing options as it will cause me and the rest of the IT department loads of trouble I'd imagine.

Thanks for the help!
 
Note that class names are not supposed to start with a number. Most browsers will cope with it, but why take chances?

It won't help your printing problem though. As far as I know, the browser's printing preferences are just that - the browser's. You can't control them from within the document, it's something that the user controls.

Try highlighting the cell in some other way as well - for example giving it a thick black border - so that people with backgrounds switched off will still get something to highlight the cell.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
I did not know that class names couldn't start with numbers. I have learned something today. It's in an all IE office system anyway, so shouldn't have mattered. I was only using that as the code I used to populate the database to generate the table used the value of 1 when a cell should be filled in.

Anyway, I've got round it by using a black gif and a white gif to represent on and off as it were.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top