I have the following attempted minimal reproducible HTML and CSS code:
https://codepen.io/EshaanGupta/pen/LYJbzqb
Objective : On a button press, I want print the table inside 'print-form' div.
<div class = "item item-content item-content-title print-form printDiv">
Problem : The background contents are spilling onto the print preview.
I tried adding position: fixed;
in @media print .printDiv
instead of position: absolute;
but that duplicates the contents into multiple pages.
Proposed solution : How can I hide the rest of the contents and only print the table and its data?
<input type='submit' class='printfeedback' name='printfeedback' value='Print Feedback' onclick='window.print()'/>
Any help or suggestion is valued and appreciated. Feel free to add comments to improve this question and I will try to edit and incorporate them.
Thank you.