<tbody>
<c:forEach var="item" items="${merchantTable}">
<tr>
<td width="15%" align="right" class="hebing" ><input type="checkbox" name="chnl_mer_code" value="${item.chnl_mer_code}" checknull="" /></td>
<td width='15%' align='right' class="hebing" >${item.chnl_mer_code}</td>
<td width='15%' align='right' >${item.pay_type}</td>
<td width='15%' align='right' >${item.service_code}</td>
<td width='15%' align='right' >${item.chnl_name}</td>
<td width='15%' align='right' >${item.chnl_code}</td>
<td width='15%' align='right' >${item.status}</td>
</tr>
</c:forEach>
</tbody>
$(function(){
$('.hebing').each(function(index, element) {
if(!$(this).hasClass('hide'))
{ var next=$(this).parent('tr').next('tr').children('.hebing');//下一个合并的对象
$(this).attr('rowspan',1);
while($(this).text()==next.text())
{
$(this).attr('rowspan',parseInt($(this).attr('rowspan'))+1);
next.hide();
next.addClass('hide');
next=next.parent('tr').next('tr').children('.hebing');//下一个合并的对象
}
}
});
});