我只是在玩弄我正在玩的应用程序的格式。它看起来像这样:
我想使用表格来获取它,以便“sd”下的所有内容都直接位于它旁边。像这样:
我怎么能这样做...使用表格?
这是我当前的代码:
<div class ="individ_post">
<table>
<tr>
<td>
<p>sd</p>
<p>sd</p>
<p>sd</p>
<p>sd</p>
<p>sd</p>
<p>sd</p>
<p>sd</p>
</td>
</tr>
<% @posts.each do |post| %>
<tr>
<td id="voting_deletion_table">
<div id="post_voting_and_deleting">
<div class="vote_score"><%= post.reputation_value_for(:votes).to_i %></div>
<br />
<% if user_is_logged_in? %>
<%= button_to "+", vote_group_post_path(@group, post, type: "up"), method: "post" %>
<%= button_to "-", vote_group_post_path(@group, post, type: "down"), method: "post" %>
<% end %>
</div>
<% if user_is_logged_in? && current_user.id == post.user_id %>
<td><%= button_to 'x', [@group, post], method: :delete, confirm: 'Are you sure?' %></td>
<% end %>
</td>
<td id="previow_of_post_table">
<div class ="preview_of_post">
<% if post.image_url %>
<%= image_tag post.image_url(:thumb).to_s %>
<% elsif post.link %>
<%= extract_content_from_url(post.link) %>
<% end %>
</div>
</td>
<td id="comments_table">
<div class ="post_author">@<%= post.user.username%>:</div> <div class ="post_title"><%= post.title %></div>
<% post.comments.each do |comment| %>
<div class ="post_comments">
> <span class="comment_username">@<%= comment.user.username %></span>:<%= comment.body %>
</div>
<% end %>
<% if user_is_logged_in? %>
<%= form_for([post.group, post, post.comments.build]) do |f| %>
<p>
<%= f.label :comment %><br />
<%= f.text_area :body, :rows => 3, :cols => 55 %>
</p>
<p>
<%= f.submit %>
</p>
<% end %>
<% end %>
</td>
</table>
</div>
<hr />
<br />
<% end %>
谢谢!