Ruby on rails 3 引导sass表格-如何生成一个跨整个表格宽度的单行,以便在表格为空时显示消息(以及列标题)

Ruby on rails 3 引导sass表格-如何生成一个跨整个表格宽度的单行,以便在表格为空时显示消息(以及列标题),ruby-on-rails-3,twitter-bootstrap,sass,Ruby On Rails 3,Twitter Bootstrap,Sass,我有一个表,我已经使用支持的htlm和css元素生成并转换成类似于引导的样式 我在代码(Rails 3.2.3)中包含了一个除非命令,用于在有数据时显示表行,但在没有数据时显示一条消息,我希望它是一行(跨越所有列) 当前显示,但不显示为单行 我试过在桌子上使用span和colspan,但无法让它看起来“干净” 这是空桌子 这是数据表 下面是用于生成表的代码 <div class="page-header"> <div class="span10"> <

我有一个表,我已经使用支持的htlm和css元素生成并转换成类似于引导的样式

我在代码(Rails 3.2.3)中包含了一个除非命令,用于在有数据时显示表行,但在没有数据时显示一条消息,我希望它是一行(跨越所有列)

当前显示,但不显示为单行

我试过在桌子上使用span和colspan,但无法让它看起来“干净”

这是空桌子

这是数据表

下面是用于生成表的代码

<div class="page-header">
  <div class="span10">
    <h1>Listing people</h1>
    <div class="contextual">
      <%= link_to(new_person_path, class: "btn btn-success") do %>
        New Person <i class="icon-plus icon-white"></i>
      <% end %>
    </div>
  </div>

<table class="table table-striped table-bordered table-condensed">
<thead>
  <tr>
    <th></th>
    <th colspan="1">Full Name</th>
    <th colspan="1">DOB</th>
    <th colspan="1">Sex</th>
    <th colspan="1">Address</th>
    <th>Actions</th>
  </tr>
</thead>
<tbody
  <tr>
  <% unless @people.empty? %>
    <% @people.each do |person| %>
      <td><%= person.id %></td>
      <td><%= link_to person.full_name, person %></td>
      <td><%= person.dob %></td>
      <td><%= person.gender_to_s %></td>
      <td>
        <% person.addresses.each do |f| %>
          <%= f.full_address %>
        <% end %>
      </td>
      <td><%#= link_to 'Edit', edit_person_path(person) %> 
        <%= link_to(edit_person_path(person), class: "btn btn-small") do %>
          Edit <i class="icon-edit icon-white"></i>
        <% end %>

        <!-- This currently works but smells -->
        <%= link_to(person, class: "btn btn-small btn-danger", confirm: t_deletion_confirm(person, person.full_name), method: :delete, :title => t('EHM-G.destroy')) do %>
          Destroy <i class="icon-trash icon-white"></i>
        <% end %>
      </td>
    <% end %>
  <tr>
  <% else %>
    <td>Move along nothing to see here<td>
  <% end %>
</tr>
</tbody>                                        
</table>

<br />

<%#= link_to 'New Person', new_person_path %>
<%= link_to(new_person_path, class: "btn btn-success") do %>
  New Person <i class="icon-plus icon-white"></i>
<% end %>
</div>

列名
新人
全名
出生日期
性
地址
行动

从未发现,但代码中的某个地方出现了错误(可能是隐藏的数字或恶意空间),因为重新编码已经纠正了它

下面是代码现在的样子。有人知道一个简单的方法来找出是什么引起的吗

  <div class="page-header">
    <h1>Listing people</h1>

  <div class="contextual">
    <%= link_to(new_person_path, class: "btn btn-success") do %>
      New Person <i class="icon-plus icon-white"></i>
    <% end %>
  </div>
</div>

<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
  <th colspan="1"></th>
  <th colspan="1">Full Name</th>
  <th colspan="1">DOB</th>
  <th colspan="1">Sex</th>
  <th colspan="1">Address</th>
  <th colspan="1">Actions</th>
</tr>
</thead>
<tbody>
  <% unless @people.empty? %>
    <% @people.each do |person| %>
      <tr>
        <td></td>
        <td><%= link_to person.full_name, person %></td>
        <td><%= person.dob %></td>
        <td><%= person.gender_to_s %></td>
        <td>
          <% person.addresses.each do |address| %>
            <%= address.full_address %>
          <% end %>
        </td>          
        <td>
          <%#= link_to 'Edit', edit_person_path(person) %> 
          <%= link_to(edit_person_path(person), class: "btn btn-small") do %>
            Edit <i class="icon-edit icon-white"></i>
          <% end %>

          <!-- This currently works but smells -->
          <%= link_to(person, class: "btn btn-small btn-danger", confirm: t_deletion_confirm(person, person.full_name), method: :delete, :title => t('EHM-G.destroy')) do %>
            Destroy <i class="icon-trash icon-white"></i>
          <% end %>

          <%#= icon_delete_link_to(person, people_path, person.full_name) %>
        </td>
      </tr>
    <% end %>
  <% else %>
    <tr>
      <td colspan="0">Nothing to see here move along please</td>
    </tr>
  <% end %>
  </tbody>
</table>
</div>

列名
新人
全名
出生日期
性
地址
行动
编辑
t('EHM-G.destroy'))do%>
毁灭
这里没什么可看的请往前走

虽然我昨天看不到这个——“以木换树综合症”,但我希望这能帮助其他人

为了我自己的学习,找出原因的最好方法是什么?对我来说,代码使用不同的方式看起来仍然相同,例如