我有一个带有排序搜索和粘性表头的表格。
我面临的第一个问题是无法将表头粘贴到表中。在滚动时它粘在窗口上。
其次,我无法重新调整表格的宽度和高度。当我将它保存在 div
标签中时,粘性 header 不起作用
请帮助我如何实现这一目标。
<script id="js">$(function(){
$("table").tablesorter({
widthFixed : true,
showProcessing: true,
headerTemplate : '{content} {icon}',
// Add icon for jui theme; new in v2.7!
widgets: [ 'uitheme', 'zebra', 'stickyHeaders', 'filter' ],
widgetOptions: {
// extra css class name applied to the sticky header row (tr) - changed in v2.11
stickyHeaders : '',
// adding zebra striping, using content and default styles - the ui css removes the background from default
// even and odd class names included for this demo to allow switching themes
zebra : ["ui-widget-content even", "ui-state-default odd"],
// use uitheme widget to apply defauly jquery ui (jui) class names
// see the uitheme demo for more details on how to change the class names
uitheme : 'jui'
}
});
});</script>
这是css的js文件
<script src="js/jquery.tablesorter.widgets.js"></script>
最佳答案
尝试做与我在 jsfiddle 上所做的相同的事情:
[http://jsfiddle.net/Ziad/2EZjJ/][1]
关于javascript - 如何修复具有粘性标题以及排序和搜索的表格的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20259436/