jquery.fixedheadertable 经测试在固定1列和2列时是对齐的,2列以上明显不对齐,须要js作调整javascript
$(document).ready(function(){ var thhead=$(".fht-fixed-column .fht-thead th"); var thbody=$(".fht-fixed-column .fht-tbody tr:eq(0) td"); for(i=0;i<thhead.length;i++) { if(thhead.eq(i).width()<thbody.eq(i).width()){ thhead.eq(i).width(thbody.eq(i).width()); }else{ thbody.eq(i).width(thhead.eq(i).width()); } } });
var thhead=$(".fht-fixed-column .fht-thead th");java
也能够写成var thhead=$(".fht-fixed-column .fht-thead ").find("th");jquery
find()是找全部的后代测试
children()只是下一级的后代code