function checkAll(obj){
if(obj.checked){
$("table input[type=checkbox]").prop("checked",true);
}else{
$("table input[type=checkbox]").removeAttr("checked");
}
$("#table input:checkbox:gt(0)").each(function(){
checkThis(this);
})
}
function checkThis(obj){
var tr = obj.parentNode.parentNode;
var tds = tr.cells;
if(obj.checked){
}else{
}
}
<table id="table" cssClass="form-control" cellspacing="0" width="100%">
<thead>
<tr>
<td><input type="checkbox" onclick="checkAll(this)"/></td>
<td>id</td>
<td>姓名</td>
<td>邮箱</td>
<td>账号</td>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" onclick="checkAThis(this)"/></td>
<td>id</td>
<td>name</td>
<td>email</td>
<td>zhanghao</td>
</tr>
</tbody>
</table>