rowspan 처리하기
2021. 1. 26. 09:04 in 팁&테크/Javascript

function rowspan(className){
var txt;
var rows;
$("." + className).each(function() {
txt = $(this).text();
if(txt.length === 0)
return true;
rows = $("." + className + ":contains('" + txt + "')");
if (rows.length > 1) {
rows.eq(0).attr("rowspan", rows.length);
rows.not(":eq(0)").remove();
}
});
}
rowspan("rowspan");
rowspan 을 원하는 td에 class 추가 호출하면 됨.