테이블 id = TheTable
$(function(){
var row = $("#TheTable tr:last");
var cursorObj = $(row.children().first());
var value = $(cursorObj).html();
var groupCount = 1;
do {
if( value == row.prev().children().first().html() ) {
cursorObj.remove();
groupCount++;
} else {
value = row.prev().children().first().html();
cursorObj.attr("rowspan", groupCount);
groupCount = 1;
}
row = row.prev();
cursorObj = row.children().first();
} while(row.length != 0);
});
html소스보기하면 rowspan이 되지 않음...
화면상으로만 rowspan이 적용되어짐.
'개발 > jQuery' 카테고리의 다른 글
[jQuery]문자 깜박임 (0) | 2018.07.24 |
---|---|
[jQuery] jQuery 셀렉트박스 이전 선택(focus) (0) | 2018.06.27 |
jQuery 엔터키 (0) | 2018.06.26 |
jquery를 이용한 아이디 저장하기(쿠키사용) (0) | 2018.06.25 |
[jQuery] jQuery로 부모창 컨트롤 (0) | 2012.11.30 |