1、列号获取
let col = $(td)[0].cellIndex;
2、获取行号
function findTypeLine(type, value)
{ let obj = {
hasParent: false,
parentLine: null,
selTd: null
};
$("td[" + type + "=" + value + "]").each(function() {
//查找key的parent--tr
obj.hasParent = true;
obj.parentLine=$(this).parents("tr").index();
obj.selTd = $(this);
return;
})
return obj;
}
for (let ind in list) {
tr[ind] = findTypeLine("key", list[ind]).parentLine;
if (tr[ind] != null) {
let tdContent = $("tr").eq(tr[ind]).find("td:eq(" + col + ")").html().split('<')[0];
if (tdContent != null && tdContent != "") {
flagcol = true;
}
}
}