在附图中,我试图使“哈利”居中,但似乎做margin: 0 auto;
不会忽略右侧的“删除”元素。有没有人知道如何在右边的“删除”按钮中居中“哈利”?
这是我现有的html
<table class="week_table" summary="Users for week">
<thead >
<tr align="center" class="TableHeader">
<th align="center" class="week_table_heading">
<%= event.date.day.to_s + " " + event.date.strftime("%B") %>
</th>
</tr>
</thead>
<!-- <tr>
<td>
<%= event.remaining_spaces? %>
</td>
</tr>-->
<% event.users.each do |user| %>
<tr >
<td class="week_table_row">
<% if user == current_user %>
<a class="RemoveButton"href=<%="welcome/remove_from_month?event_id="+event.id.to_s%>>remove </a>
<%end%>
<span class="UserName">
<%= user.first_name %>
</span>
</td>
</tr>
<% end %>
<tr align="center">
<td align="center">
<% if !event.users.include?(current_user) %>
<a href=<%="welcome/sign_up_month?event_id="+event.id.to_s%>>Sign Up</a>
<% end %>
</td>
</tr>
</table>
答案 0 :(得分:1)
先生。利斯特是对的......
你必须:
.remove {position: absolute; right:0;}
.container-harry {position:relative}
哈利将集中。