?
Solved

Problem in code

Posted on 2006-05-23
7
Medium Priority
?
201 Views
Last Modified: 2010-04-09
Hi all,

I had spent lots of time in print issue in the below code.
document.write() will not allow to print the images while going to print the screen.

Here is my code... I am using style sheet....

<html><head></head><body>
<style type="text/css">
SPAN.red {background-color: #FF6600}
SPAN.green {background-color: #6666FF}
.green { background-image: url('c:/green.jpg'); width:50px }
.red   { background-image: url('c:/blue.jpg');   width:50px }
.yellow { background-color:yellow;   width:50px }
.noyellow { background-color:;   width:50px }
.free { background-color:#660000;   width:50px }
.n { width:50px }
.suresh{  }
.green1 { background-image: url('c:/green.jpg'); width:10px }
.red1   {background-image: url('c:/blue.jpg');   width:10px }
.yellow1 { background-color:#660000;   width:10px }

</style>
<div align="center"><table><tr><td><b>Plot</b></td></tr></table></div><TABLE>
<TBODY>
<TR>
<TD>Title Comes Here.....</TD>
<TD>&nbsp;&nbsp;&nbsp;</TD>
<TD class=green1></TD>
<TD>CLR-1&nbsp;&nbsp;&nbsp;</TD>
<TD class=red1></TD>
<TD>CLR-2&nbsp;&nbsp;&nbsp;</TD>
<TD><IMG height=20 src="C:/open.jpg" width=10 border=0></TD>
<TD>CLR-3</TD></TR></TBODY></TABLE>
<TABLE class=timetable cellSpacing=0  border="0">
<TBODY>
<TR align=middle>
<TD class=wide><B><FONT size=-2>One</FONT></B>&nbsp;&nbsp;</TD>
<TD class=wide><B><FONT size=-2>Two</FONT></B>&nbsp;</TD>
<TD class=wide><B><FONT size=-2>Three</FONT></B></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>1</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>2</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>3</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>4</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>5</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>6</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>7</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>8</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>9</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>10</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>11</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>12</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>13</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>14</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>15</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>16</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>17</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>18</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>19</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>20</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>21</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>22</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>23</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>24</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>1</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>2</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>3</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>4</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>5</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>6</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>7</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>8</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>9</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>10</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>11</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>12</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>13</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>14</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>15</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>16</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>17</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>18</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>19</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>20</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>21</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>22</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>23</TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n></TD>
<TD class=n>24</TD></TR>
<TR>
<TD><FONT size=-1>Num1</FONT>&nbsp;</TD>
<TD align=middle><FONT size=-1>Data1</FONT>&nbsp;</TD>
<TD align=middle><A href="#"><IMG height=13 src="/1.gif" width=13 border=0></A></TD>
<TD class=n colSpan=5></TD>
<TD class=green title=Cerutti colSpan=12 MT - 10></TD>
<TD class=red title=Cerutti colSpan=95 MT - 10></TD>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD></TR>
<TR>
<TD><FONT size=-1>Num2</FONT>&nbsp;</TD>
<TD align=middle><FONT size=-1>&nbsp;,,</FONT>&nbsp;</TD>
<TD align=middle><A href="#"><IMG height=13 src="1.gif" width=13 border=0></A></TD>
<TD class=n colSpan=44></TD>
<TD class=noyellow colSpan=-67.24></TD>
<TD class=green title=Cerutti colSpan=28 MT - 10></TD>
<TD class=red title=Cerutti colSpan=122 MT - 10></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD class=red title=Cerutti colSpan=192 MT - 10></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD class=red title=Cerutti colSpan=92 MT - 10></TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD>
<TD>&nbsp;</TD></TR>
</TBODY></TABLE></body></html>

I have image files called green.jpg and blue.jpg, this image will display in the page, but if I take print out , the page doesn't contain images.
Can anyone help me to solve this?

Thanks
0
Comment
Question by:r_kar
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
mmarksbury earned 252 total points
ID: 16747055
By default the browser does not print background images.  It is a browser setting that the HTML cannot control.
0
 

Author Comment

by:r_kar
ID: 16747858
hi,
so how can I print that? Is there any method to solve that?
0
 
LVL 7

Expert Comment

by:mmarksbury
ID: 16748138
A few options:

1. Instead of using background images with text on top, use images that have the text as part of them.

2. (this one might work) Place a div with text on-top of an image.

It's one of those things that HTML wasnt designed for so you have to make a work around.
0
 

Author Comment

by:r_kar
ID: 16750089
hi,
my intension is to fill the colors inside TD. While printing the doc, the color is not printing.
So I got a solution from other site , if I use gif in style sheet I can get the required solution.
My green.jpg and blue .jpg files 10*10 color images...

So how can I proceed that?

thanks
0
 
LVL 5

Assisted Solution

by:Jezcentral
Jezcentral earned 248 total points
ID: 17138225
Put this line in the head:

<link href="myCssSheet.css" rel="stylesheet" type="text/css" media="print">

Then write a new stylesheet called myCssSheet.css, without the colors you don't want, and with the image you do want. The media="print" means that the stylesheet the printer uses will be the this one, and not the one you already have at the top of your HTML page.

Jezcentral.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question