I would like to print only certain part of my page. My sample code follows:
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Insert title here</title>
</head>
<body>
<div class="body">
Blah... blah...
</div>
<div class="printable">
contents goes here...
</div>
</body>
</html>
I need to print the contents of <div class="printable"></div>
. Is it possible to do this using jQuery? Should I write this solution, or is there a plugin that would help solve this problem?
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
body * { display: none; }
.printable { display: block; }
window.print();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With