Modern browsers that follows standards and IE7+
$("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>
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.
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型