`

JQuery合并表格

阅读更多
// td.attr("rowSpan", 3);
// td.remove();

jQuery(document).ready(function() {
var j = 0;
jQuery("table tr").each(function() {
   j++;
   var td = jQuery(this).find("td:eq(2)");	//从第几列开始
   if(j == 3){								//当循环到第几行时
    td.attr("rowSpan", 3);
   }
});
var j = 0;
jQuery("table tr").each(function() {
   j++;
   var td = jQuery(this).find("td:eq(2)");	//从第几列开始
   if(j == 4||j==5){						//当循环到第几行时
    td.remove();
   }
});
})


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics