huzige0265

导航

 

function merge_quadefect() { //可实现合并单元格,上下行来比较
//debugger;
var totalCols = 7; 列数
var totalRows = $("#tbSummary_@ctr").find("tr").length;
for (var i = totalCols - 1; i >= 0; i--) {
for (var j = totalRows - 1; j >= 1; j--) {
startCell = $("#tbSummary_@ctr").find("tr").eq(j).find("td").eq(i);
targetCell = $("#tbSummary_@ctr").find("tr").eq(j - 1).find("td").eq(i);
if (startCell.text() == targetCell.text() && targetCell.text() != "") {
targetCell.attr("rowSpan", (startCell.attr("rowSpan") == undefined) ? 2 : (eval(startCell.attr("rowSpan")) + 1));
startCell.remove();
}
}
}
}

posted on 2018-08-26 17:08  huzige0265  阅读(370)  评论(0编辑  收藏  举报