[jQuery] 특정 DIV안에 class Rowspan 주기
function f_RowSpanByDivName(divName, className){ var rows = $('#'+divName).find('.'+className); $('#'+divName).find('.'+className).each(function(index, row) { if( rows.length > 1 ) { var cRow = Math.floor ( rows.length / 2 ); rows.eq( cRow ).attr('rowspan', rows.length ); rows.not(":eq(" + cRow + ")").remove(); } }); } divName : 영역 DIV className : rowspan할 class 집합
PROGRAMMING/JAVASCRIPT
2020. 6. 25. 14:37