Top Questions

  • 2.9 Years

    • Category : Jquery
    • Location : Chandigarh
    • Posted On : Apr 12, 2017

    You can print specific div or area using this script

     <a href="javascript:void(0);" id="printinvoice"  class="btn btn-warning btn-sm">PRINT INVOICE</a>
    <div class="print_div">
                        <div class="col-xs-6 table-responsive">
                            <div class = "sales_header">
                                <span>ORDER NO: # 11380189</span>  
                            <table class="table table-striped table-bordered datatables dataTable">
                                        <td>Order date</td>
                                        <td>12 Apr 2017 15:55:34</td>
                                        <td>Order Status</td>
                                        <td> Processed                                    </td>
    <script src="/assets/js/jQuery.print.js"></script>
    $(document).ready(function() {
            //Print ele4 with custom options
                //Use Global styles
                globalStyles: true,
                //Add link with attrbute media=print
                mediaPrint: true,
                //Custom stylesheet
                stylesheet: "",
                //Print in a hidden iframe
                iframe: true,
                //Don't print this
                noPrintSelector: ""

Add Your Answer

When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.