Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-11-2008, 06:20 AM   PM User | #1
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
Table Background Image Does Not Print

I have a table with a background image and when I go to print the web page, the image does not show up! I have done this on 3 different computer systems with the same results!

How can I get the Table background image to print?

Thanks...
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 07-11-2008, 06:46 AM   PM User | #2
rangana
Senior Coder

 
rangana's Avatar
 
Join Date: Feb 2008
Location: Cebu City, Philippines
Posts: 1,752
Thanks: 65
Thanked 372 Times in 365 Posts
rangana will become famous soon enoughrangana will become famous soon enough
I've encountered this problem before, and after diagnosing the problem, I was convinced that it was a printer bug.
For a test, try to print this simple code:
Code:
<div style="background:#f00;height:500px;width:500px;">Test</div>
We should be able to see a text Test on a red background. See if the printer outputs the expected.
__________________
Learn how to javascript at 02geek

The more you learn, the more you'll realize there's much more to learn
Ray.ph
rangana is offline   Reply With Quote
Old 07-11-2008, 04:48 PM   PM User | #3
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
It isn't the printer. I printed on 3 different computers with 3 different printers - the table bg image did not print on any of the 3 different printers.
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 07-11-2008, 05:07 PM   PM User | #4
BWiz
Regular Coder

 
BWiz's Avatar
 
Join Date: Mar 2006
Location: Sol System
Posts: 471
Thanks: 7
Thanked 21 Times in 21 Posts
BWiz is an unknown quantity at this point
Try this:
Code:
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
Code:
/* print.css */
table.bg {
 background-color: #f00;
 color: #fff;
}
__________________
BWiz :: Happy Coding!
2006
2007 2008 2009
2010 2011
Irrational numbers make no sense.
BWiz is offline   Reply With Quote
Old 07-11-2008, 05:25 PM   PM User | #5
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Or check whether you have print specific styles which removes the background of that table.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 07-11-2008, 05:32 PM   PM User | #6
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
This is the table below. The image is a coupon type border that my customers can print out.

PHP Code:
          <TABLE border=0 width="576" height=432 background="coupon.jpg">
          <TR><TD>&nbsp;</TD></TR>
          <TR><TD align=center><?php echo $_SESSION['php_sc_coupon_header']?></TR>
          <TR><TD>&nbsp;</TD></TR>
          </TABLE>
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 07-11-2008, 06:48 PM   PM User | #7
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
Someone told me to use this:

PHP Code:
<div style="position: absolute;"
<
img src="pix/some.png" width="628" height="134" alt="" border="0"
<
table style="position: absolute; top: 0; left: 0" border=1
<
tr><td>test</td></tr
</
table
</
div
I tried that and it works (the bg image prints) - however, in my code I need to print multiple copies of this table and used <P> to space vertically - but now that doesn't work - the tables print next to each other instead of vertically. I suspect this is due to the div tag but I don't know enough about css to know how to use this solution to allow printing of vertical tables using the same bg image! Can someone help please?
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 07-11-2008, 09:13 PM   PM User | #8
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
Resolved

I found the answer - I changed this line

PHP Code:
<div style="position: absolute;"
to


PHP Code:
<div style="position: relative;"
and now my tables display and print with the BG image in each of the multiple tables.
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 07-11-2008, 09:19 PM   PM User | #9
Pepe, the bull
Regular Coder

 
Pepe, the bull's Avatar
 
Join Date: Feb 2005
Location: Vancouver, WA
Posts: 163
Thanks: 1
Thanked 16 Times in 16 Posts
Pepe, the bull is on a distinguished road
If it's just a dotted line coupon border, couldn't you just use a dotted line border.
Code:
          <TABLE style="border:1px dotted black;" width="576" height=432 background="coupon.jpg">
          <TR><TD>&nbsp;</TD></TR>
          <TR><TD align=center><?php echo $_SESSION['php_sc_coupon_header']?></TR>
          <TR><TD>&nbsp;</TD></TR>
          </TABLE>
__________________
Pepe, the bull
Pepe, the bull is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:54 PM.


Advertisement
Log in to turn off these ads.