JavaScript合并单元格
function SpanGrid(tabObj,colIndex)
{
if(tabObj != null)
{
var i,j;
var intSpan;
var strTemp;
for(i = 0; i < tabObj.rows.length; i++)
{
intSpan = 1;
strTemp = tabObj.rows[i].cells[colIndex].innerText;
for(j = i + 1; j < tabObj.rows.length; j++)
{
if(strTemp == tabObj.rows[j].cells[colIndex].innerText)
{
intSpan++;
tabObj.rows[i].cells[colIndex].rowSpan = intSpan;
tabObj.rows[j].cells[colIndex].style.display = "none";
}
else
{
break;
}
}
i = j - 1;
}
}
}