Splitting HTML page so Printer splits it into separate pages

I am planning price list available for clients online and I was thinking about simple very long page or div container with some anchor links aside to help jump to different products.

However in case someone wants to print off just price list with certain products I don't want all the pages to print off but only current one. Is there any print breaking character or tag?

Just in case someone has better idea all I want to achieve is having price list in html to change it in one place but still be able to convert separate product price lists into PDF files for emailing purposes of particular product.


Solution 1:

Use this CSS:

@media print
{
      .page-break  { display:block; page-break-before:always; }

}

and then cite this in your HTML where you want the page to break:

<div class="page-break"></div>

And there you go :)

Solution 2:

As per w3schools, you can also do the following:

@media print {
  .page {page-break-after: always;}
}

and then, in your HTML:

<div class="page">
  <!-- Page Contents -->
</div>

Or, if you have a footer under every page (for example for page numbering):

@media print {
  footer {page-break-after: always;}
}