首页 > 代码库 > 计算合并行、列

计算合并行、列

function autoRowSpan(tb,row,col){
var lastValue="";
var value="";
var pos=1;
for(var i=row;i<tb.rows.length-1;i++){
value = http://www.mamicode.com/tb.rows[i].cells[col].innerText;
if(lastValue =http://www.mamicode.com/= value){
tb.rows[i].deleteCell(col);
tb.rows[i-pos].cells[col].rowSpan = tb.rows[i-pos].cells[col].rowSpan+1;
pos++;
}else{
lastValue = http://www.mamicode.com/value;
pos=1;
}
}
}

计算合并行、列