【发布时间】:2012-08-24 08:31:34
【问题描述】:
我有网格和打印图标..如果我单击打印图标,我应该打印网格。但是打印输出中没有显示网格线。
我该怎么办?
这是我的代码
<div style="float: right" id="hide_div"><a href="javascript:void(0)" onclick="printPage('pnlMainHeader','div_print');"><img src="<?=$this->baseUrl('/images/icons/small/print.png')?>" title="Print" alt="Print" /></a></div>
<div class="clear10"></div>
<div class="pnlMainHeader" id="pnlMainHeader" style="display: none; ">
//some xyz code
</div>
<div class="clear10"></div>
<div id="div_print">
//grid code
<?=$this->TemplateRoles?>
</div>
和.js文件中的onclick printPage代码
function printPage(printpage1, printpage2)
{
var hideDiv = document.getElementById('hide_div')
hideDiv.style.display = 'none';
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr1 = document.getElementById(printpage1).innerHTML;
var newstr2 = document.getElementById(printpage2).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr1+newstr2+footstr;
window.print();
document.body.innerHTML = oldstr;
location.reload();
return false;
}
请帮帮我..
【问题讨论】:
-
有没有机会为
clear10显示css?可能是一些时髦的东西。 -
嗨 Fluffeh,感谢您的回复,这里是 css 代码 .clear10 { clear: both;可见性:隐藏;高度:10px; }