티스토리 뷰


   위와 같이 소속에 같은 데이터가 있을 경우 하나의 셀로 병합해주는 코드다.


$(document).ready(function(e){
	genRowspan("td 클래스명");
});

function genRowspan(className){
	$("." + className).each(function() {
		var rows = $("." + className + ":contains('" + $(this).text() + "')");
		if (rows.length > 1) {
			rows.eq(0).attr("rowspan", rows.length);
			rows.not(":eq(0)").remove();
		}
	});
}


rowspan.html


댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함