구름과 바람 그리고 나그네 :: [jQuery] rowspan

[jQuery] rowspan

개발/jQuery 2011. 7. 5. 14:13

테이블 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이 적용되어짐.

Posted by pressrain
,