Print Specific Elements On Page - jQuery printObject

File Size: 2.97 KB
Views Total: 2756
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Print Specific Elements On Page - jQuery printObject

printObject is a tiny jQuery print plugin which enables the users to print any html elements with custom header and footer on the webpage.

How to use it:

1. Just include the jQuery printObject plugin's script printObject.js after jQuery JavaScript library and you're ready to go.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="printObject.js"></script>

2. The JavaScript to print the html table within your document.

$("table").printObject();

3. Print the html table with custom header & footer.

$("table").printObject({
  header: "<h2> jQuery Script </h2>",
  footer: '<a href="ht​tp://jqueryscript.net"> JQuery Script </a>',
});

4. Apply your own styles to the header & footer.

$("table").printObject({
  header: "<h2> jQuery Script </h2>",
  header_style: 'color: red;',
  footer: '<a href="ht​tp://jqueryscript.net"> JQuery Script </a>',
  footer_style: "color: blue; font-size: 14px;"
});

This awesome jQuery plugin is developed by Ciepcin. For more Advanced Usages, please check the demo page or visit the official website.