Recently, when printing for customers, the customer asked not to print the head of the page when printing, but to print the contents in the form, because the head has a background and a printing button, and it is a thin line form. I think the thin line form is not very simple.
If you don't know how to do a thin line table, please see the following code to achieve the effect:)
<table cellSpacing=0 cellPadding=0 border=0>
<tr>
<td bgcolor='black'>
<table cellSpacing=1 cellPadding=1 border=0>
<tr align=center bgcolor='#ffffff'>
<td colspan=2>National</td><td colspan=1>City</td>
</tr>
<tr bgcolor='#ffffff' align=center>
<td>People's Daily</td>
<td>Liberation Daily</td>
<td>Xinmin Evening News</td>
</tr>
</table>
</td>
</tr>
</table>
Then set IE to print the background, I thought it would be done
As a result, I printed a preview and found a big black block on the head. Why? Because there is a background inside my head, it took up the page!
.gTitle
{
width:100%;
height:32px;
line-height:32px;
background-image:url(images/gtitle.gif);
padding-left:130px;
margin-bottom:10px;
}
I started to feel depressed. I searched online for a long time but couldn't have a perfect solution. I decided to do it myself.
After thinking about it for a long time, I finally got it done :)
Css is defined as follows:
noneprint: The style definition hidden when printing
tabPrint: Thin line table style definition to print
nextPate: style definition for pagination
linetd: Haha, here is the most important thing, make your form perfect when printing
Copy the code