使用css如何实现分页打印

使用css如何实现分页打印

这篇文章将为大家详细讲解有关使用css如何实现分页打印,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

css print属性如下:

使用css如何实现分页打印

分页实例(此处借用网上例子):

<div><input type="button" value="打印" onclick="Print()" /></div>  
<div id="page1">  
        <table width="100%"  border="0" cellpadding="0" cellspacing="0"  style="page-break-after:always" >  
        <tr><td>第一页打印内容</td></tr>  
        </table>  
</div>  
<div id="page2">  
        <table width="100%"  border="0" cellpadding="0" cellspacing="0" id="content" >  
        <tr><td>第二页打印内容</td></tr>  
        </table>  
</div>  
</body>  
</html>

关于使用css如何实现分页打印就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。