0
我在网页中有这样的结构,假设表格很长。在每张印张上重复内容
<header>
<h1><img src="//some_logo.jpg"/> 2016 Report</h1>
</header>
<section>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
</section>
<footer>
<h3><img src="//some_image.jpg"/> 2016 © The report company</h3>
</footer>
和我需要的是打印这个长表,但与我的页眉和我的页脚重复在每一页。
像这样
我已经与position:fixed
页眉和页脚,但事情尝试是,标题下的内容分片,并在每个页面页脚。
CSS3规则在Chrome中无效。
我没有找到任何解决方案与JS。
任何想法?
你看了下面的问题[如何使用HTML在每个打印页上打印页眉和页脚?](http://stackoverflow.com/questions/1360869/how-to-use- html-to-print-header-footer-on-every-printed-page)? – DavidDomain
将“”和“
”添加到您的表格中。 –@DavidDomain我已经看到了,但没有运气。 – George
回答
这个例子应该工作。请参阅代码中的注释。
来源
2016-07-15 20:47:01
我认为不工作... http://output.jsbin.com/zopetegaso – George
你试过了吗打印? Google Chrome浏览器打印预览不会在每个页面上显示页眉和页脚。 FF和IE呢。 –
我从Chrome和Firefox打印出来(以防与它有关),但没有运气。 – George
在打印介质样式表的CSS下面使用。 (更好地利用类名或ID选择,以避免意外搞乱与页面的其他地方类似的标记。)
来源
2016-07-14 22:11:06
我想这不工作或我做错了http://i.imgur.com/lwDbrCO.png – George
相关问题