标签:
public void MergeCell(TableRow trow) { TableCell currentCell = trow.Cells[0]; TableCell prevCell = null; for (var i = 0; i < trow.Cells.Count; i++) { currentCell = trow.Cells[i]; if (prevCell != null && currentCell.Text == prevCell.Text) { prevCell.ColumnSpan = (prevCell.ColumnSpan == 0 ? 1 : prevCell.ColumnSpan) + 1; currentCell.Visible = false; } else { prevCell = currentCell; } } }
标签:
原文地址:http://www.cnblogs.com/thirties/p/5156564.html