2015-10-15 201 views
4

我的问题是,打印内容

  • 我想打印在水平和垂直方向 滚动里面的内容

enter image description here

<button class="printtable">Print</button> 
<div id="applicationtableDiv"> 
<table> 
<!-- table content --> 
</table> 
</div> 
<script type="text/ecmascript" src="<?php echo base_url() ?>js/print.js"></script> 
<script> 
jQuery(document).ready(function($) { 
    $('body').on('click', '.printtable', function(event) { 
       event.preventDefault(); 

       $('#applicationtableDiv>table').print(); 
       }); 
}); 
</script> 

我使用这个插件 click here

这个插件是为我工作,但我想打印滚动x和y

打印的内容里面出来的记录 enter image description here

回答

0

要创建一个滚动条的表格只是把它包内divoverflow:auto风格:

<div style="overflow:auto"> 
    <!-- your table goes here --> 
</div> 

就这样。

+0

丹灵我不想创建滚动条。我想打印滚动内容。 – daulat