Javascript 按一定角度打印页面
我想用angulaJS打印一个给定的页面,所以a做了这个简单的解决方案:Javascript 按一定角度打印页面,javascript,angularjs,Javascript,Angularjs,我想用angulaJS打印一个给定的页面,所以a做了这个简单的解决方案: <div class="modal fade" id="extrait" aria-hidden="true" data-backdrop="false"> <table class="table table-hover table-bordered" id="tab1"> <thead> <tr cl
<div class="modal fade" id="extrait" aria-hidden="true" data-backdrop="false">
<table class="table table-hover table-bordered" id="tab1">
<thead>
<tr class="row-name" >
<th >Banque</th>
<th>N. Cheque</th>
<th>Montant</th>
</tr>
</thead>
<tbody>
<tr class="row-content" ng-repeat="cl in extraits">
<td>{{cl.nomBanque}}</td>
<td>{{cl.numCheque}}</td>
<td>{{cl.montant}}</td>
</tr>
</tbody>
</table>
<div class="btn-group" role="group">
<button id="btnPrint" class="btn btn-info btn-block" ng-click="print()">Print</button>
</div>
</div>
<script>
$scope.print=function(){
$window.print();
};
</script>
班克
支票
蒙坦特
{{cl.nomBanque}
{{cl.numCheque}
{{cl.montant}}
印刷品
$scope.print=function(){
$window.print();
};
它可以工作,但是当我有一个很长的列表要打印时,它只打印一页,滚动条就会出现。我想打印第1页,第2页。。。。你有什么建议吗。谢谢。您可以使用css3媒体查询进行打印,如下所示:
@media print {
body, html, #wrapper {
width: 100%;
}
}
或者您可以使用单独的css文件并使用以下百分比值:
<link rel="stylesheet" href="css/print.css" type="text/css" media="print"/>
我做了第二个解决方案:在print.css中,我有:#extratit{width:100%}但同样的问题是滚动条出现了,并且只有一个页面我认为问题来自模式,因为我想在模型中打印的内容。当我试着打印一个普通的页面时,它可以工作,但是使用模式有一个问题。我刚刚在print.css中添加了:#print content*{visibility:visible;overflow:visible;}和另一个模型的css属性
body, html, #wrapper {
width: 100%;
}