2016-01-24 41 views
0

我的表格單元格之一中的按鈕組出現問題。 它看起來像下面的圖片我提出:Boostrap +表格行中的按鈕組下的空白空間

enter image description here

查看文件:

= render 'layouts/navbar' 
= render 'layouts/sidebar' 

div class = 'container-fluid' 
    div class = 'col-sm-2' 
    div class = 'col-sm-10' 
    h1 Listing Copies 
    table class = 'table table-hover' 
     thead 
     tr 
      th Title 
      th Author 
      th Photo 
      th Options 

     tbody 
     - @copies.each do |copy| 
      tr class = 'warning' 
      td = copy.book.title 
      td = copy.book.author 
      td = image_tag(copy.photo, class: 'preview') 
      td class = 'btn-group' 
       - if copy.returned? 
       = link_to 'Rent', new_history_path(copy_id: copy.id), class: 'btn btn-primary' 
       - else 
       = link_to 'Rent', new_history_path(copy_id: copy.id), disabled: true, class: 'btn btn-danger' 
       = link_to 'Show', copy, class: 'btn btn-default' 
       = link_to 'Edit', edit_copy_path(copy), class: 'btn btn-default' 
       = link_to 'Destroy', copy, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default' 
    = link_to 'New Copy', new_copy_path, class: 'btn btn-default' 

而且一些CSS:

.btn-group { 
    display: flex; 
} 

任何建議將真正幫助我。謝謝。

回答

0

好的,我解決了這個問題 - 我不應該在做td class = 'btn-group'。取而代之:

td 
    div class = 'btn-group'