Ads

Tuesday 18 November 2014

PrintMe – jQuery plugin for print page element








printme



















Download   Demo

This Jquery Plugin PrintMe is a lightweight jQuery Plugin to print any html element.

1. INCLUDE JS FILES
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="path_to/jquery-printme.js"></script>
2. HTML
<div id="dataexample">
    <table class="table">
        <thead>
            <tr>
                <th>Col1</th>
                <th>Col2</th>
                <th>Col3</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td> A </td>
                <td> B </td>
                <td> C </td>
            </tr>
            <tr>
                <td> D </td>
                <td> E </td>
                <td> F </td>
            </tr>
        </tbody>
    </table>
</div>
3. JAVASCRIPT
$("#dataexample").printMe();
4. OPTIONS
  • path: External css file location
  • title: The document header title
$("#example").printMe({ "path": "path_to/eternal.css", "title": "Document title" });

No comments:

Post a Comment