Print-friendly css for SQLTABLE?

99 views
Skip to first unread message

Dave S

unread,
Sep 25, 2013, 3:51:35 PM9/25/13
to web...@googlegroups.com
Is there an example of setting up print-friendly CSS for a page that uses SQLTABLE?  If not, suggestions as to which file (...project/static/css/web2py.css, web2py_bootstrap.css, ...) I should start in to roll my own?

If in Opera 12.16 on Fedora 16, trying to print a selection area inside the table does it neatly ... except for no line breaks.  Print the whole page gives a lot of cruft (like the links).  This also happens on Opera 12.16 on Windows 7 also has these issues.

Firefox (18 on F16, 24 on W7) and Chrome 29.0.1547.76 m on W7 don't seem to have these issues, but I've been using Opera for my AppAdmin activities, and I thought I could help it a bit with some CSS magic.

/dps

Dave S

unread,
Oct 4, 2013, 4:25:49 PM10/4/13
to web...@googlegroups.com
FF 18 on F16 isn't free of issues:  running the admin database tool, printing the results of the query will include the links behind the ID column.

Any suggestions where to start to set up a print-friendly css?

/dps

Paolo Caruccio

unread,
Oct 4, 2013, 5:41:29 PM10/4/13
to web...@googlegroups.com
  @media print {
    a
[href]:after {
      content
:"";
   
}
 
}

The above code should hide all the links within anchor tags in the printed page. Please put the rule at the bottom of your custom css file or wrap it in a <style> tag just before </head> in layout.html

Dave S

unread,
Oct 4, 2013, 6:19:40 PM10/4/13
to web...@googlegroups.com


On Friday, October 4, 2013 2:41:29 PM UTC-7, Paolo Caruccio wrote:
  @media print {
    a
[href]:after {
      content
:"";
   
}
 
}

The above code should hide all the links within anchor tags in the printed page. Please put the rule at the bottom of your custom css file or wrap it in a <style> tag just before </head> in layout.html

Beautiful!  It works like a charm!

Thank you very much.

/dps
 

Derek

unread,
Oct 4, 2013, 8:19:47 PM10/4/13
to web...@googlegroups.com
I use 'save the trees' which is a browser plugin that allows me to select what to print. Of course, it only works if you have it installed...\
Reply all
Reply to author
Forward
0 new messages