2013-03-12 117 views
6

更新使用position: relative: TD,TH 然后,拖着jQuery的阻力表边界问题停止

enter image description here

工作后

enter image description here

表格边框消失的时候罚款莫兹拉和ie,但不是在铬

的jsfiddle here

HTML

<table> 
    <tr> 
     <th>id</th> 
     <th>name</th> 
     <th>city</th> 
    </tr> 
     <tr class="person"> 
     <td>1</td> 
     <td>abc</td> 
     <td>abc</td> 
    </tr> 
     <tr class="person"> 
     <td>2</td> 
     <td>xyz</td> 
     <td>xyz</td> 
    </tr> 
</table> 

CSS

table{ 
    border-collapse : collapse; 
} 

td, th{ 
    border : 1px solid #000; 
    padding : 5px 20px; 
} 

th{ 
    background-color : #f3f3f3; 
} 

.drag { 
    background-color : #f3f3f3; 
    height : 20px; 
    width : 100px; 
} 

JS

$('.person').draggable({ 
    helper : function(){ 
     return $('<div class="drag">Drag me</div>') 
    }, 
    cursor : 'crosshair', 
    cursorAt : {left : 50}, 
    start : function(){ 
     $(this).hide(); 
    }, 
    stop : function(){ 
      $(this).show(); 
    } 
}); 

回答

1

从表css中删除边框崩溃似乎已经做到了。

table{ 
     /* border-collapse : collapse */ 
} 

退房在http://jsfiddle.net/YTZrj/1/

+0

它不工作。 – 2013-03-12 04:59:30

+0

我只在Chrome上检查过,在我的工作中,底部边框显示正常 – zdesam 2013-03-12 05:04:36