我的问题是,
<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
内的内容答案 0 :(得分:0)
要为您的表创建滚动条,只需将其div
包裹在overflow:auto
样式中:
<div style="overflow:auto">
<!-- your table goes here -->
</div>
就是这样。