admin管理员组文章数量:1026989
I am using tablesorter jquery to sort the column in my table. I want to freeze my table header. Is there any way to do that using tablesorter jquery? Thanks in advance.
My tablesorter code:
("#rates").tablesorter({
widgets: ['zebra'],
widgetZebra: {
css: ["even", "odd"]
},
headers: {
0: {
sorter: false
},
4: {
sorter: false
}
},
headerClass: 'header',
sortClassAsc: 'headerSortUp',
sortClassDesc: 'headerSortDown'
});
I also tried this.
widgetOptions: {
stickyHeaders : 'tablesorter-stickyHeader',
},
I am using tablesorter jquery to sort the column in my table. I want to freeze my table header. Is there any way to do that using tablesorter jquery? Thanks in advance.
My tablesorter code:
("#rates").tablesorter({
widgets: ['zebra'],
widgetZebra: {
css: ["even", "odd"]
},
headers: {
0: {
sorter: false
},
4: {
sorter: false
}
},
headerClass: 'header',
sortClassAsc: 'headerSortUp',
sortClassDesc: 'headerSortDown'
});
I also tried this.
widgetOptions: {
stickyHeaders : 'tablesorter-stickyHeader',
},
Share
Improve this question
edited Jun 21, 2013 at 9:16
kishore
asked Jun 21, 2013 at 7:41
kishorekishore
1,6475 gold badges16 silver badges17 bronze badges
2
-
1
Your code is missing
$
orjQuery
? – Broxzier Commented Jun 21, 2013 at 8:01 -
Please note the stickyHeaders widget &
widgetOptions
only work with this fork of tablesorter, not the original from tablesorter.; Tablesorter (either version) does not include options likeheaderClass
,sortClassAsc
,sortClassDesc
. And lastly, the forked version moved thewidgetZebra
option intowidgetOptions
aszebra
. – Mottie Commented Feb 20, 2015 at 13:45
2 Answers
Reset to default 2You can add this to your tablesorter initialization:
$(‘table’).tablesorter({
widgets: ['stickyHeaders']}
)
This would activate 1st row freezing automatically. Make sure to remove exisitng scrolling techniques like: overflow: auto;
See my post about this and how to add your custom HTML header, if needed. Please let me know if it helps :)
Use this code to stick your table header:
widgetOptions: {
// css class name applied to the sticky header row (tr)
stickyHeaders : 'tablesorter-stickyHeader',
}
I am using tablesorter jquery to sort the column in my table. I want to freeze my table header. Is there any way to do that using tablesorter jquery? Thanks in advance.
My tablesorter code:
("#rates").tablesorter({
widgets: ['zebra'],
widgetZebra: {
css: ["even", "odd"]
},
headers: {
0: {
sorter: false
},
4: {
sorter: false
}
},
headerClass: 'header',
sortClassAsc: 'headerSortUp',
sortClassDesc: 'headerSortDown'
});
I also tried this.
widgetOptions: {
stickyHeaders : 'tablesorter-stickyHeader',
},
I am using tablesorter jquery to sort the column in my table. I want to freeze my table header. Is there any way to do that using tablesorter jquery? Thanks in advance.
My tablesorter code:
("#rates").tablesorter({
widgets: ['zebra'],
widgetZebra: {
css: ["even", "odd"]
},
headers: {
0: {
sorter: false
},
4: {
sorter: false
}
},
headerClass: 'header',
sortClassAsc: 'headerSortUp',
sortClassDesc: 'headerSortDown'
});
I also tried this.
widgetOptions: {
stickyHeaders : 'tablesorter-stickyHeader',
},
Share
Improve this question
edited Jun 21, 2013 at 9:16
kishore
asked Jun 21, 2013 at 7:41
kishorekishore
1,6475 gold badges16 silver badges17 bronze badges
2
-
1
Your code is missing
$
orjQuery
? – Broxzier Commented Jun 21, 2013 at 8:01 -
Please note the stickyHeaders widget &
widgetOptions
only work with this fork of tablesorter, not the original from tablesorter.; Tablesorter (either version) does not include options likeheaderClass
,sortClassAsc
,sortClassDesc
. And lastly, the forked version moved thewidgetZebra
option intowidgetOptions
aszebra
. – Mottie Commented Feb 20, 2015 at 13:45
2 Answers
Reset to default 2You can add this to your tablesorter initialization:
$(‘table’).tablesorter({
widgets: ['stickyHeaders']}
)
This would activate 1st row freezing automatically. Make sure to remove exisitng scrolling techniques like: overflow: auto;
See my post about this and how to add your custom HTML header, if needed. Please let me know if it helps :)
Use this code to stick your table header:
widgetOptions: {
// css class name applied to the sticky header row (tr)
stickyHeaders : 'tablesorter-stickyHeader',
}
本文标签: javascripttablesorter jqueryhow to fix column headersStack Overflow
版权声明:本文标题:javascript - tablesorter jquery - how to fix column headers - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745618446a2159431.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论