Chrome works great, but I'm having trouble printing the styling on IE and FireFox (especially).
I've gone through many forum posts and I know it's probably something simple.
function printMe() {
printCSS = new String ('<link href="/a/b/file.css" rel="stylesheet" media="print" type="text/css">')
window.frames["print_frame"].document.body.innerHTML=printCSS + document.getElementById('div').innerHTML;
window.frames["print_frame"].window.focus();
window.frames["print_frame"].window.print();
window.frames["print_frame"].window.document.close();
}
<div class="print-button"><input id="btnSubmit" type="submit" value="Print" class='print-btn' onclick="printMe();" /></div>
@media print {
.page-break{
page-break-after: always;
}
.print-button{
display: none !important;
}
}