Javascript 如何确定具有粘性标题以及排序和搜索的表的大小?
我有一个带有排序搜索和粘性表头的表。 我面临的第一个问题是无法将标题与表格粘在一起。将其滚动到窗口上。 其次,我无法重新调整桌子的宽度和高度。当我把它放在Javascript 如何确定具有粘性标题以及排序和搜索的表的大小?,javascript,jquery,css,tablesorter,sticky,Javascript,Jquery,Css,Tablesorter,Sticky,我有一个带有排序搜索和粘性表头的表。 我面临的第一个问题是无法将标题与表格粘在一起。将其滚动到窗口上。 其次,我无法重新调整桌子的宽度和高度。当我把它放在div标签中时,粘性头就不起作用了 请帮助我如何做到这一点 <script id="js">$(function(){ $("table").tablesorter({ widthFixed : true, showProcessing: true, headerTemplat
div
标签中时,粘性头就不起作用了
请帮助我如何做到这一点
<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>
$(函数(){
$(“表”).tablesorter({
是的,
是的,
headerTemplate:“{content}{icon}”,
//为jui主题添加图标;在v2.7中新增!
小部件:['uitheme','zebra','stickyHeaders','filter'],
widgetOptions:{
//应用于粘性标题行(tr)的额外css类名-在v2.11中更改
粘滞标题:“”,
//添加斑马条纹,使用内容和默认样式-ui css从默认样式中删除背景
//本演示包含偶数和奇数类名,以允许切换主题
zebra:[“ui小部件内容偶数”,“ui状态默认奇数”],
//使用uitheme小部件应用默认的jquery ui(jui)类名
//有关如何更改类名的更多详细信息,请参阅uitheme演示
尤瑟姆:“瑞”
}
});
});
这是css的js文件
<script src="js/jquery.tablesorter.widgets.js"></script>
尝试与我在JSFIDLE上所做的相同:
[http://jsfiddle.net/Ziad/2EZjJ/][1]
现在有一个测试,但它仍在测试中
尽管上述共享的当前可用版本不允许将粘性头附加到其父级,但此功能仍存在一个漏洞(有关更新,请参阅)。最后一个需要克服的问题是让标题正确地粘贴在Firefox中(cssStickyHeaders\u addCaption
选项)
如果能帮我找到任何其他需要解决的问题,我将不胜感激,除了边界不与粘性单元格保持一致(LOL,我不知道如何解决这个问题)。stickyHeaders小部件目前无法“粘住”其父元素;它只会粘贴到浏览器窗口。有一个已经发布了,我只是还没来得及回复。如果有解决方案,请分享。。
$(function () {
$("table").tablesorter({
widgets: ['cssStickyHeaders'],
widgetOptions: {
cssStickyHeaders_offset: 0,
cssStickyHeaders_addCaption: true,
cssStickyHeaders_attachTo: null
}
});
});