如何打印网络表格? [英] How to Print a Webform?
问题描述
朋友们,
我想打印一个网络表单,我用一个按钮进行打印.
打印页面时如何隐藏按钮?
Srinivas Vadepally
Hi friends,
i would like to print a webform,i used a button to print.
How can i hide the button while printing the page?
Srinivas Vadepally
推荐答案
在网页的标题标签中添加以下样式
Add following style in head tag of the web page
<style type="text/css" media="print">
.PrintStyle { display:none; }
</style>
然后在您的按钮中使用此类,如下所示
and then use this class in your button as follows
<input type='button' id="btn1" value='Print' class='PrintStyle' />
(' 此 .css(" , " ); window.print(); 此 .css(" , " ); });
('#btn1').click(function(){ this.css("visibility","hidden"); window.print(); this.css("visibility","visible"); });
* btn1是按钮的ID.
*不要忘了在文档中添加对jquery的引用.
*如果要打印div或html文档的某些部分,而不是整个文档.访问:
http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/ [
*btn1 is the id of the button.
* Don''t forget to add a reference to jquery above in your document.
* If you want to print some div or some part of the html document and not the whole document. Visit:
http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/[^]
* If you need any other support do let me know.
I hope I answered your question.
Watch my first article posted on codeproject and comment and vote:
http://www.codeproject.com/KB/HTML/speechinputapi.aspx
or http://blog.robinrizvi.info
Drop me a mail for any comments, suggestions or questions.
mail@robinrizvi.info
这篇关于如何打印网络表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!