Jquery- Jqprint实现网页打印功能
2017-08-16 16:09
731 查看
Html部分:
<div id="test">
<style type="text/css">
.tt tr td{
font-size: 12px;
}
</style>
<h3 class="text-center">标题</h3>
<table class="table table-bordered table_detail" style="margin-top: 30px;">
<tbody class="tt">
</tbody>
</table>
</div>
按钮(自己可以添加样式:以下用的是bootsrap样式):
<button type="button" class="btn btn-info btn-sm" id='print'><i class="fa fa-print"></i> 打印</button>
文件引入:
<import file="lib.js.jquery#jqprint" />
<script type="text/javascript">
$(document).on("click","#print",function(){ //控制按钮。
$("#test").show();
$("#test").jqprint();
$("#test").hide();
});
</script>
如果要实现手动分页:在要分页的结尾处加上<div style="page-break-after:always;"></div>
<div id="test">
<style type="text/css">
.tt tr td{
font-size: 12px;
}
</style>
<h3 class="text-center">标题</h3>
<table class="table table-bordered table_detail" style="margin-top: 30px;">
<tbody class="tt">
</tbody>
</table>
</div>
按钮(自己可以添加样式:以下用的是bootsrap样式):
<button type="button" class="btn btn-info btn-sm" id='print'><i class="fa fa-print"></i> 打印</button>
文件引入:
<import file="lib.js.jquery#jqprint" />
<script type="text/javascript">
$(document).on("click","#print",function(){ //控制按钮。
$("#test").show();
$("#test").jqprint();
$("#test").hide();
});
</script>
如果要实现手动分页:在要分页的结尾处加上<div style="page-break-after:always;"></div>
相关文章推荐
- jQuery:实现网页的打印功能
- web的各种前端打印方法之jquery打印插件jqprint实现网页打印
- web的各种前端打印方法之jquery打印插件jqprint实现网页打印(转载)
- jQuery-jqprint实现打印功能
- 基于jQuery实现网页打印功能
- 使用jquery.jqprint.js 实现的打印功能,IE9不能进行打印预览、火狐打印空白界面
- web的各种前端打印方法之jquery打印插件jqprint实现网页打印
- 基于jQuery实现网页打印功能
- web的各种前端打印方法之jquery打印插件PrintArea实现网页打印
- 使用jquery.jqprint.js 实现的打印功能,IE9不能进行打印预览、火狐打印空白界面
- jQuery实现区域打印功能代码详解
- jQuery实现网页放大镜功能
- asp.net 实现在线打印功能,jQuery打印插件PrintArea实现自动分页
- Jquery、Js实现网页打印,及打印样式的自定义
- jquery实现网页查找功能示例分享
- 利用Websocket实现网页调用打印功能
- 自写jQuery插件,实现简单网页遮罩层/弹出层功能,兼容IE6、IE7
- jquery局部区域打印功能实现
- 网页中实现打印功能
- 使用jquery-cookie实现网页“不再提示”功能