Currently, I am working on a project that has already been completed but now requires some enhancements. To give you an overview, the project includes a search functionality that displays additional details upon clicking on the displayed name in the result. The client has requested the addition of a print option to allow printing the displayed content, which I have successfully implemented. However, the main issue arises with the print preview not taking into account the CSS from the last page as it is defined internally in the HTML code. I have tried referring to resources like "Print the contents of a DIV", but they utilize external CSS styles. Can someone guide me on how to incorporate internal CSS for the print preview?
Edit: I attempted using the @print tag to address the CSS issue but it did not work effectively, hence why I request assistance in keeping this question unique.
P.S. I did not create this poorly-coded section, it was created by someone else - see https://i.sstatic.net/QC3mH.png.