Search code examples
jqueryhtmlprintthis

Can "printThis" print a table and a div on the same page?


I'm using printThis Jquery plugin. I use it to print out a table. But now i want to add a div below the table. Is that possible?

My code prints the table and the div on two seperate papers.

HTML

<table id="list_usr_time" class="display"></table
<div class="display" id="sum_worked_time"></div>

JS

$(document).ready(function () {
    $('#print_btn').click(function () {
        $('#list_usr_time').printThis();
        $('#sum_worked_time').printThis();
    });
});

Solution

  • The answear was pretty simple! Just edited the JS.

    JS

    $(document).ready(function () {
        $('#print_btn').click(function () {
            $('#list_usr_time, #sum_worked_time').printThis();
        });
    });