mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Merge pull request #2586 from Waterticket/admin-colspan-fix
Fix 관리자 페이지에서 th의 colspan을 반영하여 데이터의 colspan을 수정하도록 개선
This commit is contained in:
commit
8b8758f296
1 changed files with 11 additions and 1 deletions
|
|
@ -367,7 +367,17 @@ jQuery(function($){
|
|||
$.fn.tableSpan = function(){
|
||||
this.each(function(){
|
||||
var $this = $(this);
|
||||
var thNum = $this.find('>thead>tr:eq(0)>th').length;
|
||||
var thList = $this.find('>thead>tr:eq(0)>th');
|
||||
var thNum = 0;
|
||||
thList.each(function(){
|
||||
var $th = $(this);
|
||||
if($th.attr('colspan')){ // th의 colspan 반영
|
||||
thNum += parseInt($th.attr('colspan'), 10);
|
||||
} else {
|
||||
thNum++;
|
||||
}
|
||||
});
|
||||
|
||||
var $tdTarget = $this.find('>tbody>tr:eq(0)>td:only-child');
|
||||
if(thNum != $tdTarget.attr('colspan')){
|
||||
$tdTarget.attr('colspan', thNum).css('text-align','center');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue