Loop for printing per page

Asked

Viewed 38 times

0

I have a loop:

<?php for($i=0; $i<=20; $i++){ ?>
<div id="">
   <?php echo $i; ?>
</div>
<?php } ?>

I need each of these Divs to appear separately at the time of printing, that is, one item per page, regardless of the height of the div, I would like it to be only one div per page, how could I do that? I will in print / print in PDF.

1 answer

3


In the place you want to break the page, put this command:

<div style="page-break-after: always"></div>

Will break to the next page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.