如何将样式gridview打印出来? [英] How to do styling gridview to print it?
本文介绍了如何将样式gridview打印出来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要表格格式的页面。
我尝试了什么:
I need my page in table format.
What I have tried:
var prtWindow = window.open(windowUrl, windowName,
'left=100,top=100,right=100,bottom=100,width=700,height=500');
prtWindow.document.write('');
prtWindow.document.write('');
prtWindow.document.write(gridData.outerHTML);
prtWindow.document.write('');
prtWindow.document.close();
prtWindow.focus();
prtWindow.print();
prtWindow.close();
推荐答案
使用 @ media rule [ ^ ]定义打印机的格式...
Use @media rule[^] to define formatting for printer...
Gridview只是在浏览器上呈现时的表格。所以基本上你只需要打印一张桌子。
参见示例 -
仅打印表格 - JavaScript / HTML [ ^ ]
打印表 - JSFiddle [ ^ ]
还有,查看 CSS媒体查询 [ ^ ]并检查
KR
Gridview is just a table when it is rendered on the browser. So basically you just need to print a table.
See examples-
Table Print Only - JavaScript / HTML[^]
Print Table - JSFiddle[^]
And also, look at the CSS Media Queries[^] and check
KR
这篇关于如何将样式gridview打印出来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文