1:JS(JQuery)向Table中动态加入tr、td
var cacheTable = $("#CacheUsersTable");
var row = $("<tr></tr>");
var td1 = $("<td>" + name + "</td>");
var td2 = $("<td>" + department + "</td>");
row.append(td1);
row.append(td2);
cacheTable.append(row);
2:JS(JQuery)修改table中某个td的值
function ChangeCurrentCacheUsersStatus(name, department) {
var rows = $("#CacheUsersTable tr");
for (var i = 0; i < rows.length; i++) {
if (rows[i].cells[0].innerHTML == name) {
rows[i].cells[1].innerHTML == department;
return true;
}
}
return false;
}
3: