html
<table class="table" width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr class="lineTh">
<th width="30"><i class="checkIcon allCheckbox"></i></th>
<th>接警值班员</th>
<th>接警时间</th>
<th>接警类型</th>
<th>接警人姓名</th>
<th>接警人联系方式</th>
<th>船长</th>
<th>联系电话</th>
<th>船号</th>
<th>带队领导</th>
<th>出航时间</th>
<th>受理处置</th>
<th>移交</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
<tr>
<td><i class="checkIcon"></i></td>
<td>马涛</td>
<td>2017-12-12 09:56</td>
<td>纠纷</td>
<td>白泽郡</td>
<td>15678898889</td>
<td>秒永存</td>
<td>18798767789</td>
<td>苏赣渔0878</td>
<td>刘勇参谋长</td>
<td>2017-12-12 09:56</td>
<td>调解处理</td>
<td>渔政部门</td>
<td>
<a href="#" class="eye">查看</a>
<a href="#" class="edit">编辑</a>
<a href="#" class="delete">删除</a>
</td>
</tr>
</tbody>
</table>
js
$(function(){
//全选或全不选
$(".allCheckbox").click(function() {
if ($(this).hasClass('checked')) {
$("tbody .checkIcon").removeClass('checked');
} else {
$(this).addClass('checked');
$("tbody .checkIcon").addClass('checked');
}
});
//设置全选复选框
$("tbody .checkIcon").click(function() {
$(this).toggleClass('checked');
allchk();
});
});
//设置全选复选框
function allchk() {
var chknum = $("tbody .checkIcon").size(); //选项总个数
var chk = $("tbody .checked").length;
if (chknum == chk) { //全选
$(".allCheckbox").addClass('checked');
} else { //不全选
$(".allCheckbox").removeClass('checked');
}
}