【发布时间】:2015-06-21 16:51:45
【问题描述】:
<table class="table table-striped table-bordered">
<thead>
<tr>
<th><%= model_class.human_attribute_name(:id) %></th>
<th><%= model_class.human_attribute_name(:projectid) %></th>
<th><%= model_class.human_attribute_name(:ppiho) %></th>
<th><%= model_class.human_attribute_name(:needby) %></th>
<th><%= model_class.human_attribute_name(:quantity) %></th>
<th><%= model_class.human_attribute_name(:model) %></th>
<th><%= model_class.human_attribute_name(:prnum) %></th>
<th><%= model_class.human_attribute_name(:ponum) %></th>
<th><%= model_class.human_attribute_name(:status) %></th>
<th><%= model_class.human_attribute_name(:contact) %></th>
<th><%= model_class.human_attribute_name(:notes) %></th>
<th><%= model_class.human_attribute_name(:created_at) %></th>
<th><%=t '.actions', :default => t("helpers.actions") %></th>
</tr>
</thead>
<tbody>
<% @orders.each do |order| %>
<tr>
<td align="center"><%= link_to order.id, order_path(order) %></td>
<td align="center"><%= order.projectid %></td>
<td align="center"><%= order.ppiho %></td>
<td align="center"><%= order.needby %></td>
<td align="center"><%= order.quantity %></td>
<td align="center"><%= order.model %></td>
<td align="center"><%= order.prnum %></td>
<td align="center"><%= order.ponum %></td>
<td align="center"><%= order.status %></td>
<td align="center"><%= order.contact %></td>
<td align="center"><%= order.notes %></td>
<td align="center"><%=l order.created_at %></td>
<td>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
edit_order_path(order), :class => 'btn btn-default btn-xs' %>
<%= link_to t('.destroy', :default => t("helpers.links.destroy")),
order_path(order),
:method => :delete,
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
:class => 'btn btn-xs btn-danger' %>
</td>
</tr>
<% end %>
</tbody>
</table>
虽然我可以让实际的表格数据居中,但无论我尝试将标题居中如何,它都会拒绝。我需要把这些事情集中起来。如果有人有任何想法,我将不胜感激。
如果我能让它们居中,我可以继续尝试让标题冻结。
【问题讨论】:
标签: twitter-bootstrap twitter header centering