我有一个如下所示的页面。
现在我正在尝试通过使用 twitter boostrap 来复制它<div class= hero-unit>
。我做了以下事情:
<div class="center hero-unit">
<table class="form">
<tr>
<td>
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation" xmlns="http://www.w3.org/1999/html">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
</td>
</tr>
<tr>
<td class="th" colspan="2">Login Details</td>
</tr>
<tr>
<% if @user.id %>
<td><%= f.label :id %></td>
<td><%= @user.id %></td>
<% end %>
</tr>
<tr>
<td><%= f.label :current_sign_in_at, "Sign in time" %></td>
<td><%= @user.current_sign_in_at.nil? ? "Not signed in" : @user.current_sign_in_at.strftime('%d-%b-%Y %H:%M:%S') %></td>
</tr>
<tr>
<td> <%= f.label :first_name %>
<br/></td>
<td><%= @user.first_name %></td>
</tr>
<tr>
<td><%= f.label :last_name %>
<br/></td>
<td><%= @user.last_name %></td>
</tr>
<tr>
<td><%= f.label :email %>
<br/></td>
<td><%= @user.email %></td>
</tr>
<% if can? :manage, :all %>
<tr>
<td class="th" colspan=2>Roles and Privileges</td>
</tr>
<tr>
<% for role in Role.all %>
<td><%= role.name %><%= check_box_tag "user[role_ids][]", role.id, @user.roles.include?(role), :disabled => true %></td>
<% end %>
</tr>
<% end %>
<tr>
<td>
<%= link_to 'Edit', edit_user_path(@user), :class => 'btn btn-medium' %> |
<%= link_to 'Back', usermanagement_path, :class => 'btn btn-medium' %>
</td>
</tr>
</table>
<table class="form" >
<% if @user == current_user %>
<caption><b>Previous Orders</b></caption>
<thead>
<tr>
<th>Order No:</th>
<th>Order Date</th>
<th>Quantity</th>
<th>Total</th>
<th>View Order</th>
</tr>
</thead>
<% current_user.orders.each do |order| %>
<tr>
<td style="width: 10px;"><%= order.id %></td>
<td><%= order.created_at.to_s(:short) %></td>
<td><%= order.quantity %></td>
<td><%= number_to_currency(order.total_price, :unit => "£") %></td>
<td><%= link_to 'View Order',(order)%></td>
</tr>
<% end %>
<% if current_user.orders.empty? %>
<tr>
<td>No bookings found</td>
</tr>
<% end %>
</table>
</div>
<% end %>
<% end %>
上述更改输出以下内容:
所以我的问题是我怎样才能让它与login details
. 我确实尝试<table style="float: left; margin-left: 20px;">
在Previous Orders
桌子上做以下事情。为什么这不起作用!