打印滚动x和y方向div的内容

时间:2015-10-15 11:24:33

标签: jquery css

我的问题是,

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

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

1 个答案:

答案 0 :(得分:0)

要为您的表创建滚动条,只需将其div包裹在overflow:auto样式中:

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

就是这样。