0

Print View of Grails

This is how the table of an employee page looks when I want to print it. How do I change the layout to be able to print out something close to enter image description here

Dónal
  • 185,044
  • 174
  • 569
  • 824
Krizia Simon
  • 167
  • 1
  • 2
  • 11

1 Answers1

0

This has nothing much to do with Grails, rather than CSS.

To style pages for printing, you have to use CSS media query

That code in your css looks like this:

@media print {
  all your element styles for printing
 }

You can also have a different file for printing like this:

<link rel="stylesheet" media="print" href="print.css">

See more info here and here for inspecting print styling

Community
  • 1
  • 1
Mike B
  • 2,756
  • 2
  • 16
  • 28
  • thank you, I edited my post to include css, I placed the tag grails since i didn't know where to start with this or where to put the additional file for printing – Krizia Simon Aug 02 '16 at 07:32
  • gsp file stays the same and you don't change it (obviously). css file for printing is in the same folder as the rest of the css files (or you just include css media query in your regular css file). just one little media query (in which you put the regular css stuff) does the trick. – Mike B Aug 02 '16 at 07:39