Previous Message
Next Message

Ability to print a header at the top of each page

Sent by Syntactic: Jim Wilkinson on 29 October 2004 14:02


Hi Michael,

> 1). Is there a CSS solution which would allow a report HEADER and FOOTER  
> to repeat on each printed page?

This may go some way to meeting your needs since the facility is supported  
by both of your target browsers, FF and (remarkably) IE:-

http://css-discuss.incutio.com/?page=PrintingTables

Another possibility is to use CSS positioning to put a header at the top  
of each printed page (contrast the header that browsers put on each page  
directly). Here is some rough example code (although I would actually  
avoid using @media):-

div#printhead {
position: fixed; top: 0; left: 0; width: 100%; height: 2em;
padding-bottom: 1em;
border-bottom: 1px solid;
margin-bottom: 10px;
}

@media screen {
  div#printhead {
  display: none;
  }
  div#docbody {
  margin-top: 0;
  }
}

@media print {
  div#printhead {
  display: block;
  }
  div#docbody {
  margin-top: 3em;
  }
}

<body>

<div id="printhead">
<p>
This is the print page header
</p>
</div>

<div id="docbody">
....
</div>

I haven't tested this cross-browser and I suspect support is too flaky to  
be a practical proposition.

If you can provide a URL in due course, perhaps to a non-live  
proof-of-concept page, I'd be very interested to see what you can achieve.

-- 
Jim Wilkinson

Cardiff, Wales UK

Opera e-mail client: http://www.opera.com/m2/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: