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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table printing tips.... 1

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Nov 21, 2003
4,769
11
38
58
US
OK, I'm sure this one has been beaten into the ground at one point or another, but here goes....

I have this nice little (ok, HUGE) form that I've developed... I've gotten my CSS to re-format everything for printing, which is quite nice... everything fits the way it's supposed to.

But on some of the tables, I have shaded backgrounds, like where it says "Client Info" it's all shaded a nice grey all the way across the page, as a separator.

I want to be able to print that shaded background.

Now, keeping in mind that this form will be used on probably 2000 computers, turning on "print background images" isn't an option; it's gotta fly as-is.

Sooooo.... any way to override that? CSS? As a 40% grey graphic overlayed? Someone has to have figured out a way to shade the background of a table cell when printing...

IE6, Btw, as the browsers in use.

Thanks in advance!


Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
  • Thread starter
  • Moderator
  • #3
I suppose that would work as a separator... it's better than having the separator "lost" in the rest of the page.

Someone was talking about having a graphic, setting an absolute position relative to the edge of the table/cell I want to print, and overlaying the text on top with a DIV... but I wouldn't even know where to start on that.....

Besides, the "absolute" position may not be absolute, depending on the information preceeding the separator....



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
Someone was talking about having a graphic"

That would work if the graphic was specified in the HTML document.

Example:
Code:
<img src="[URL unfurl="true"]http://domain.com/background.jpg">[/URL]
But if it is specified as a CSS background it wouldn't show

Example:
Code:
background-image: url( [URL unfurl="true"]http://domain.com/background.jpg[/URL] );

M. Brooks
 
  • Thread starter
  • Moderator
  • #5
Sooo.... (not to be dense here, but it is almost quitting time, and I've been coding all day....)

Ummm... something like:

<table border="0" width="100%">
<img src="tblbackground.gif" width="100%">
<tr><td>Client Info</td></tr>
</table>

???



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
  • Thread starter
  • Moderator
  • #7
I'm going to leave it as the bordered table.... it's good enough for this project (I hope... lol)

Star for answering, though! Thanks again!



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
This is the way i'd get the image in there

Code:
<table>
<!-- table stuff here -->
</table>
<img src="[URL unfurl="true"]http://domain.com/background.jpg"[/URL]
    style="position: relative; top: -100px; left: -10px; z-order: -1">

you may have to fiddle with the top and left css attibutes to get it where you want it, but this'll make the image appear behind the table. As it's an image and not a background image, it'll get printed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top