PHP jquer网页打印插件 PrintArea
<!DOCTYPE html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>index</title> </head> <body> <div style="text-align:center; margin-top: 30px"> <div id="printArea"> <div>......文本打印区域......</div> <div>......文本打印区域......</div> <div>......文本打印区域......</div> <div>......文本打印区域......</div> <div>......文本打印区域......</div> </div> <br> <br> <input id="btnPrint" type="button" value="打印文本区域"></input> <input id="btnPrintFull" type="button" value="全屏打印"></input> </div> </body> <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script> <script src="https://blog-static.cnblogs.com/files/ningjiabing/jquery.PrintArea.min.js"></script> <script> $("#btnPrint").click(function(){ $("#printArea").printArea(); }); $("#btnPrintFull").click(function(){ $("body").printArea(); }); </script> </html>