On one of my pages in my website(coded in php), i’m trying to add 2 (even more) print buttons each one printing a portion of the webpage. For example, on a page there is a table with some values and 2 graphs underneath it. I would like to add 2 print buttons, one button printing the table and the other one printing both the graphs. I’ve found this Example but could not understand clearly. Any help or examples would help me.
Thanks in advance.
A simple idea is to create some previous css printing rules ad hoc, e.g.
and
then the two buttons should add a
.printtableand a.printtableandgraphclass for the body element (or other element containing your table and graphs) just beforewindow.print()statement(if user click twice or more on the same print button check previously if the element has already set that class name)