How to use HTML to print header and footer on every printed page of a document?

前端 未结 20 1413
迷失自我
迷失自我 2020-11-21 16:51

Is it possible to print HTML pages with custom headers and footers on each printed page?

I\'d like to add the word \"UNCLASSIFIED\" in Red, Arial, size 16pt to the t

20条回答
  •  猫巷女王i
    2020-11-21 17:23

    If you can use javascipt, have the client handle laying out the content using javascript to place elements based on available space.

    You could use the jquery columnizer plugin to dynamically lay out your content in fixed size blocks and position your headers and footers as part of the rendering routine. http://welcome.totheinter.net/columnizer-jquery-plugin/

    See example 10 http://welcome.totheinter.net/autocolumn/sample10.html

    The browser will still add its own headers or footers if enabled in the os. Consistent layout across platforms and browsers will likely require conditional css.

提交回复
热议问题