I don't know how to do it in jQuery, but it's simple in CSS. You can
transform it to jQuery, using .css().


Insert at the begin of document content:

<div id="printhead">Your header for printing</div>


Insert at the end of document content:
<div id="printfoot">Your footer for printing</div>


Create this styles with media="screen":

#printhead {
  display: none;
}

#printfoot {
  display: none;
}

Create this styles with media="print":

#printhead {
 display: block;
 position: fixed;
 text-align: center;
 top: 0px;
 left: 0px;
 width: 100%;
 border-bottom: 1px solid #000000;
}

#printfoot {
 margin-top: 25px;
 width: 100%;
 text-align: right;
}



This example show you, how to print header on each page and footer on
last page. You can modify CSS for print both on each page.

Hope it's help.


On 3 srp, 11:16, "m.ugues" <m.ug...@gmail.com> wrote:
> Hallo all.
>
> I need to enhance the window.print function adding an header and a
> footer to the page.
>
> Is there any way or suggestion to achieve this goal?
>
> Kind regards
>
> Max

Reply via email to