javascript - 如何修复具有粘性标题以及排序和搜索的表格的大小?

标签 javascript jquery css tablesorter sticky

我有一个带有排序搜索和粘性表头的表格。 我面临的第一个问题是无法将表头粘贴到表中。在滚动时它粘在窗口上。 其次,我无法重新调整表格的宽度和高度。当我将它保存在 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/

相关文章:

javascript - JavaScript array.length 的时间复杂度

For 循环中的 Javascript If 语句适用于 Chrome 和 Safari,但不适用于 Firefox

jquery - 如何在有一定延迟的情况下调用jquery函数onload?

javascript - Materialise 可折叠导航不工作

php - 根据 walker 内 wordpress 中的页面 ID 更改 CSS

Javascript 函数正在劫持空格键

javascript - Chrome 扩展程序 : add image to DOM

javascript - 当 fadeToggle() 永远淡出元素时?

php - 我们如何才能将值(value)添加到具有飞行效果的篮子中

css - 创建类似于 Masonry 的水平滚动布局