On my page I have a div that loads content from my database. This div can only contain 5 rows. If the database contains more that 5 rows, a new div is created with the same ID). On my screen everything works great. I’m trying to create a print button. So far, the print menu shows when pressed. The only thing going wrong: I can only print the first div. What do I need to adjust to create a page for each div, so every div is printed on a piece of paper?
The div:
[code]
content page 1 comes here
My script:
<script>
function printDiv(printableArea) {
$("#kolomInstellen").hide();
var printContents = document.getElementById('printableArea').innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
$("#kolomInstellen").show();
}
</script>