Back

固定table的header. (fixed table header)

发布时间: 2016-06-19 08:27:00

有两种办法:  

纯css:   https://jsfiddle.net/dPixie/byB9d/3/ 比较麻烦。不用了。

使用jquery: http://www.fixedheadertable.com/ 这个极其简单。

用法:

1. 先声明一个table.  (包含了thead, tfoot, tbody)

<table>
<thead>
<tr>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<td></td>
</tr>
</tfoot>
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>

2.  创建:

	$('selector').fixedHeaderTable({
		create: function() { ... }
	});
		

Back