<style type="text/css"> #colRTab{ width:100%; border-collapse: collapse; table-layout: fixed; } #colRTab td{ border:1px #dddddd solid; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; } </style> <body> <table class="basic_table_con basic_table_bottom" id="colRTab"> <tr> <td width="4.4%"><input type="checkbox" id="QuotationListCheckAll" onclick="CheckBoxGroup(this, 'QuotationListCheckOne')" /></td> <td width="13.8%">报价单编号</td> <td width="12.9%">申请人</td> <td width="12%">联系电话</td> <td width="11.5%">报价总金额</td> <td width="9.7%">创建者</td> <td width="14.4%">创建时间</td> <td width="21.3%" style="border-right:none;">操作</td> </tr> <tbody class="basic_table_con basic_table_bottom" id="QuotationList" style="display:none;"> <!-- ko foreach:QuotationListrows --> <tr data-bind="css: { basic_table_trbg: ($index()%2==0) }"> <td width="4.4%"><input type="checkbox" class="QuotationListCheckOne" onclick="CheckBoxOne('QuotationListCheckAll', 'QuotationListCheckOne')" data-bind="value:Quotation_ID" /></td> <td width="13.8%" data-bind="text:Quotation_ID"></td> <td width="12.9%" data-bind="text:Apply_Customer"></td> <td width="12%" data-bind="text:Apply_Tel"></td> <td width="11.5%" data-bind="text:Amount.toFixed(2)"></td> <td width="9.7%" data-bind="text:Create_SubUser"></td> <td width="14.4%" data-bind="text:FormatallDate(Create_Date)"></td> <td width="21.3%" style="border-right:none;"> <span class="msk_table_btn1 msk_btn" data-bind="click:OpenQuotationEditView.bind($data,Quotation_ID)">编辑</span> <span class="msk_table_btn2 msk_btn" data-bind="click:OpenQuotationAddNeedView.bind($data,Quotation_ID)">生成需求单</span> </td> </tr> <!-- /ko --> </tbody> </table> </body> <script src="http://www.h5al.cn/js/jquery-1.11.3.min.js"></script> <script src="~/Scripts/colResizable-1.6.min.js"></script> <script> $("#colRTab").colResizable({ liveDrag: true, draggingClass: "dragging" }) </script>
表头必须在table里,“#colRTab”表格中必须包含表头和表体,js初始化方法要放在获取完数据表格绑值完再执行
标签:colResizable,表格,列可,colRTab,表头,table,固顶 From: https://www.cnblogs.com/liufeiran/p/16932080.html