jQuery(document).ready(function($) { $('bo-6ren">
gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 08:56:10 26 4
gpt4 key购买 nike

我的问题是,

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

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

最佳答案

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

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

就这些。

关于jquery - 打印滚动x和y方向div的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33147250/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com