如何在我的项目页面上放置打印链接/按钮来打印信息? [英] How can I put a print link/button on my project page to printout an infomation?
本文介绍了如何在我的项目页面上放置打印链接/按钮来打印信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序(学生注册)使用 Rails,我需要一个打印链接/按钮来打印一些学生的信息.请问我该怎么办?
I am using Rails for my application(student register) and i need a print link/button to print out some student's information. Please what do I do?
推荐答案
您可以使用此标签制作打印链接.
You can use this tag to make a print link.
<%= link_to 'print', 'your_link_here', :onclick => 'window.print();return false;'%>
现在,如果要打印特定部分,可以使用 css 媒体类型
Now, if you want to print a specific section, you can use media types of css
/*This css will only works when you print*/
@media print {
body {
background: #FFF;
}
}
这篇关于如何在我的项目页面上放置打印链接/按钮来打印信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文