5 Star 13 Fork 0

MJ PC Lab / jquery-table-fixed-header

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
ISC

jQuery table fixed header

Compatibility

Modern browsers that follows standards and IE7+

Usage

$("table").tableFixedHeader();
$("table").tableFixedHeader({
	headerRows: 2		//if your header have more than 1 row
	/*, other options */
});
<!--
Table with `fixed-header` class will enable fixed header automatically.
Options can be specified by `data-` attribute`.
-->
<table class="fixed-header" data-header-rows="2">
	......
</table>

Html Structure

The fixed header element will keep the same table group container as original table(such as thead or tbody).

The fixed header is just cloned from the original table. It follows after the original one to get CSS stylesheet rules applied as much as possible. Inline styles will also be cloned. However, the id attribute will be removed from cloned elements to make sure the id is unique in the page. If you apply your CSS by id, that would not work for cloned elements.

Options

headerRows
The number of leading rows from table that will be fixed.

fixedClass
CSS class for cloned fixed table.

fixedTop
Top offset of the fixed header. Can be a number (of pixels) or a function that returns the value. Useful if you already have a fixed page header.

scrollContainer
Determine the parent scroll container. Fixed header will locate based on that container.

ISC License Copyright (c) 2020, MJ PC Lab Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

简介

Make table header fixed on the top when scrolling down. 当往下滚动时固定表头到顶部。 展开 收起
TypeScript 等 3 种语言
ISC
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/mjpclab/jquery-table-fixed-header.git
git@gitee.com:mjpclab/jquery-table-fixed-header.git
mjpclab
jquery-table-fixed-header
jquery-table-fixed-header
master

搜索帮助