我的问题是,
<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>
Run Code Online (Sandbox Code Playgroud)
我正在使用这个插件, 请点击这里
这个插件对我有用,但我想打印滚动 x 和 y 内的内容
要为表格创建滚动条,只需将其包裹在样式div中即可overflow:auto:
<div style="overflow:auto">
<!-- your table goes here -->
</div>
Run Code Online (Sandbox Code Playgroud)
就这样。
| 归档时间: |
|
| 查看次数: |
519 次 |
| 最近记录: |