How do I send parts of a page to a printer


#1

I am needing to generate a report based on some data. However, I want to be able to print off on paper just the report part of the page, excluding the page background, navbar, and things of that nature. How can I go about printing just the table/report section when the user presses a button?

–edit Using Ember 2.6.0


#2

Silly me, I’m using bootstrap and I can just use the css classes provided to hide stuff when being printed. Mods feel free to delete.


#3

Could you elaborate on how to do this using bootstrap or post a link to more info please?


#4

You don’t need Bootstrap to do this. The @media CSS rule can be used to create custom styling for a page when it is being printed. You can hide whatever you want by making CSS rules nested under @media print

@media print {
  .report {
    background: none;
  }
}


#5

I advise doing what @RustyToms says. But if you alreday are using bootstrap, you might as well take advantage of the css provided by it. Here is a link: http://getbootstrap.com/css/#responsive-utilities-print