(function ($) {
$.fn.extend({
//表格合并单元格行,colIdx要合并的列序号,从0开始,rowIdx开始合并行序号,从0开始
"rowspan": function (colIdx, rowIdx) {
return this.each(function () {
var that, rowspan;
$('tr:gt(' + rowIdx + ')', this).each(function (row) {
var td = $(this).find("td").eq(colIdx);
if (that && td.html() == that.html()) {
rowspan = that.get(0).rowSpan;
if (!rowspan) {
that.get(0).rowSpan = 1;
rowspan = 1;
}
rowspan = Number(rowspan) + 1;
that.get(0).rowSpan = rowspan;
td.hide();
} else {
that = td;
}
});
});
}
});
})(jQuery);
$(function () {
$(dsData).rowspan(0, 0);
})
//单元格合并js,其他地方需要的话,更换表格对象ID