This is the html code.
This is how the page looks like
When I print the page using window.print() I get the following: pdf screenshot
I want the exact alignment and styles that are applied in the webpage to be applied when it is printed. What should I do to print the whole page or only the div below the print button??
When the page is large window.print() doesnot print the whole page.
edit(webpage screenshot)enter image description here
I think this link will help you. https://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/