d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Html Print Header On Every Doc
Add Reply New Topic New Poll
Member
Posts: 18,138
Joined: May 31 2010
Gold: 7.27
Feb 1 2017 11:44am
[print preview] the 'Notice of shipment' needs to be printed on every page thats printed. however when I programmed it, it prints over other data being printed.



this is what the document actually looks like pre print


here is the css/table it goes with. I know fixed is what making it print on the left but it still prints over existing data
Code

@media print{
#header{
display: block;
position: fixed;

}
}

.docinfo, docinfo>td{
font-size: 11pt;
float: right;
text-align: left;
width:35%;
}
---------------------------------------------------
<table id="header" class="docinfo">
<tr>
<th style="font-size:18pt">Notice of Shipment</th>
</tr>

<tr><td> <strong>Number</strong>: #shipment_no#</td></tr>
<tr><td><strong>Date</strong>: #DATE#</td></tr>
<tr><td><strong>FOB</strong>: #freight#</td></tr>
<tr><td><strong>Ship via</strong>: #SHIP_VIA#</td></tr>
</table>
Member
Posts: 1,741
Joined: Feb 8 2008
Gold: 2,186.00
Feb 2 2017 02:53am
Quote (Trig @ Feb 1 2017 07:44pm)
I know fixed is what making it print on the left but it still prints over existing data


Fixed positioning is just like absolute positioning - the only difference is, that element's containing block is the viewport. Which means that fixed element is removed from the normal flow of the document - that's why it's getting printed over other contents.

Go Back To Programming & Development Topic List
Add Reply New Topic New Poll