开发者

HTML print webpage with different headers

I want to print a webpage that will print more than one page. In the first page i want a header and in the following ones different headers should appear.

The question is that in the first page I have a label that has enough text to pass to the second page, being the header in the second page the same as the first. I want that the second page header be different.

To define the headers i use the following approach:

<table>
 开发者_Python百科    <thead>
             (...Header Html Code)           
     </thead>
     <tbody>
            (...Html Code with label with a lot of text)
     </tbody>
</table>


You can define different CSS files for print and view, (there is even an option to define one for braile readers or mobile) So you can define some divs with ids of "webonly" "printonly" and hide them by CSS

<link rel="stylesheet" type="text/css" href="path/to/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="path/to/print.css" media="print" />

Firstly, in the stylesheet for displaying on screen...

div#header {
 font-family: verdana;
 margin: 4px 4px 4px 4px;
 font-size: large;
 font-weight: bold;
 background-color: #c0c0c0;
 border: #191170 2px solid;
}

...and then in the printable stylesheet

div#header {
 font-family: arial;
 font-weight: bold;
 font-size: 20px;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜