'issue with print new content on new page with jquery

I want to do content print for that I have made below code

 w = window.open(window.location.href,"_blank");
w.document.open();
w.document.write(res);
w.document.close();
w.window.print();

everything is working properly but when the table has more content and it is continued on the next page it is showing overlap like enter image description here

I want it table continued it shows on next page

can anybody help me with this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source