10

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.

Milosz
  • 327
  • 1
  • 3
  • 10

1 Answers1

22

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 :)

  • thank you soooooooo much. you are a life-saver :D :D – BARIS KURT Jan 06 '17 at 18:28
  • 1
    Thank you sooooooooooooooooooooooooooooooooo much. Spent whole day fixing some page issue while printing, now just added this and it works as expected :) Just in case if anyone wants to add margin to each page along with page break. .page-break { display:block; page-break-before:always; margin-top: 2cm;} – Ashik Nesin Oct 09 '18 at 09:21