I am having a popup window where the data has been dynamically created and push into that popup window.Inside the Popup window i am having an option to print that details.So while selecting that option using jQuery the "popup.print();" is called and the print preview page is displayed.Here i want to insert "Page Break " after each 15 rows.How can i do that?Please help.
Eg:
Suppose the dynamic data that pushed to Popup Page is
<div>
<table>
<tr><td>1<td></tr>
<tr><td>2<td></tr>
........
........
<tr><td>40<td></tr>
</table>
</div>
This data is passed to a jQuery function "PrintStringData(data);" on "Print" button click and defined like
function PrintStringData(Data) {
var Printdatas = Data;
var tmp = document.createElement("DIV");
tmp.innerHTML = Printdatas;
Printdatas = tmp.textContent || tmp.innerText || tmp.innerHTML || tmp.outerHTML || "";
popup = window.open(null, '', 'toolbar=0,titlebar=0,fullscreen=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 82,top = 54', '');
popup.document.write(Printdatas);
popup.print();
}