$(function() {
//2013연간자금운용계획
if($('input[name="othbcList.othbcListSn"]').val()==0){
$('input:radio[name="othbcList.smsSndngAt"]:eq(1)').attr('checked', true);
$('input:radio[name="othbcList.emailSndngAt"]:eq(1)').attr('checked', true);
}
$('#btn_guidance_sms').css("cursor", "pointer").bind('click', function() {
$("#popup05_frame").attr("src",iframeUrl);
$('.popup05').dialog('open');
});
$('#btn_guidance_email').css("cursor", "pointer").bind('click', function() {
$("#popup06_frame").attr("src",iframeUrl);
$('.popup06').dialog('open');
});
$('#btnExcelUpload').css("cursor", "pointer").bind('click', function() {
var param = "?bsnsPk=11545-900000642&othbcIemSn=346";
param+= "&year="+$('#year').val();
param+= "&uploadIemSeCode=04";
$("#popup03_frame").attr("src",iframeUrl);
$('.popup03').dialog('open');
});
$("#tabs").ttabs();
//-------rowspan 적용하기--------//
setRowspan(2);
//-------------------------------//
//-------colspan 적용하기--------//
$.fn.mergeTable = function() {
var $sibling_td, rowSpan, colSpan;
// td colSpan merge
$(this).find('tr').each(function(tr_idx, tr_el) {
$(this).find('th').each(function(td_idx, te_el) {
if ($sibling_td == undefined) {
$sibling_td = $(this);
return;
}
if ($(this).hasClass(
'merge')
&& $sibling_td.hasClass(
'merge')
&& $(this).text()
== $
sibling_td.text()) {
$(this).hide();
} else {
$sibling_td = $(this);
}
});
$(this).find('td').each(function(td_idx, te_el) {
if ($sibling_td == undefined) {
$sibling_td = $(this);
return;
}
if ($(this).hasClass(
'merge')
&& $sibling_td.hasClass(
'merge')
&& $(this).text()
== $
sibling_td.text()) {
$(this).hide();
} else {
$sibling_td = $(this);
}
});
});
});
};
$('table tbody').mergeTable();
});
/**
* Row 확인
*/
function setRowspan(cols) {
if (cols < 0) return;
var tName = "";
var fIdx = 0;
var count = 0;
var rows = 0;
var totRowspan = 0;
//$('.tbl01>tbody>tr').each(function(n) {
$('.tbl01>tbody>.trStart').each(function(n) {
var imsiName = $(this).find('th:eq('+cols+')').text();
if (tName != imsiName) {
if (n > 0 && count > 1) {
//var tdList = $('.tbl01>tbody>tr');
var tdList = $('.trStart');
for (i = fIdx + 1; i < n; i++) {
//$('.tbl01>tbody>tr:eq('+i+')').find('th:eq('+cols+')').remove();
$('.trStart:eq('+i+')').find('th:eq('+cols+')').remove();
}
//$('.tbl01>tbody>tr:eq('+fIdx+')').find('th:eq('+cols+')').attr('rowspan', count);
$('.trStart:eq('+fIdx+')').find('th:eq('+cols+')').attr('rowspan', count);
//$('.trStart('+fIdx+')').find('th:eq('+cols+')').attr('rowspan', count);
}
totRowspan += (count - 1);
tName = imsiName;
fIdx = n;
count = 0;
}
rows = n;
count++;
});
setRowspan(cols - 1);
}
<tbody>
<!-- 시작부분 -->
<tr style="display: none;">
<td>
<input type="hidden" name="iemClNm" value="전월이월액" />
<input type="hidden" name="iemClNo" value="001001" />
<input type="hidden" name="dc" value="전월 또는 전년도 이월 예금 및 현금시재액(인출하여 보유하고 있는 소액현금) 잔액의 합" />
</td>
</tr>
<tr class="trStart">
<th class="merge textAlignC">전월이월액</th>
<th class="merge textAlignC">전월이월액</th>
<th class="merge textAlignC">전월이월액</th>
<th class="merge textAlignC">전월이월액</th>
<td><input type="text" tabindex="2" name="amount" value="" class="inputBox02 textAlignR input_box" id="prevMonth" title="전월 또는 전년도 이월 예금 및 현금시재액(인출하여 보유하고 있는 소액현금) 잔액의 합" alt="currency"/></td>
<td class="last"><input type="text" title="입력" name="rm" value="" class="inputBox02 textAlignL" /></td>
</tr>
<!-- 시작부분 -->
<tr style="display: none;">
<td>
<input type="hidden" name="iemClNm" value="분양금수입" />
<input type="hidden" name="iemClNo" value="001002" />
<input type="hidden" name="dc" value="" />
</td>
</tr>
<tr style="display: none;">
<td>
<input type="hidden" name="rm" value="" />
<input type="hidden" name="amount" value="" />
</td>
</tr>
<!-- 20160524 웹표준1 -->
<tr style="display: none;">
<td>
<input type="hidden" name="iemClNm" value="조합원분양금수입" />
<input type="hidden" name="iemClNo" value="001002001" />
<input type="hidden" name="dc" value="" />
</td>
</tr>
<!-- 20160524 웹표준2 -->
<tr style="display: none;">
<td class="merge textAlignC">
<input type="hidden" name="rm" value="" />
<input type="hidden" name="amount" value="" />
</td>
</tr>
</tbody>