jquery动态合并单元格(根据主列合并)
程序员文章站
2022-05-23 13:07:46
...
var start_row ; var row_num = 0; $("#userTable tr").each(function(i){ if(i==0){ start_row = $(this); }else{ if($(this).find("td:eq(1)").text() == start_row.find("td:eq(1)").text()){ row_num ++ ; $(this).find("td:eq(0)").hide(); $(this).find("td:eq(1)").hide(); $(this).find("td:eq(8)").hide(); $(this).find("td:eq(9)").hide(); $(this).find("td:eq(10)").hide(); start_row.find("td:eq(0)").attr("rowSpan",row_num); start_row.find("td:eq(1)").attr("rowSpan",row_num); start_row.find("td:eq(8)").attr("rowSpan",row_num); start_row.find("td:eq(9)").attr("rowSpan",row_num); start_row.find("td:eq(10)").attr("rowSpan",row_num); }else{ start_row = $(this); row_num ++ ; } } });
下一篇: STRUTS2属性注入参数值重复传递问题