這是我的代碼,我想要顯示書桌上的書籍細節。如果其他條件工作不正常?
<div class="tab-pane" id="computer"> <!-- Branch Computer -->
<legend> Computer Science</legend>
<table class ="table table-hover">
<thead>
<tr>
<th> S.No </th>
<th> Book Name </th>
<th> Year </th>
<th> User ID</th>
<th> Owner Address</th>
</tr>
</thead>
<tbody>
<% @books.each do |b| %>
<tr>
<% if b.branch == "Computer Science"%>
<td><%= b.id%></td>
<td><%= b.book_name%></td>
<td><%= b.year%></td>
<td><%= b.user_id%></td>
<!-- For displaying user details -->
<% @susers.each do |s|%>
<% if s.user_id == b.user_id %>
<td><%= s.address %></td>
<%else%>
<td><%"Not found"%></td>
<%end%>
<%end%>
<%else%>
<td><%"No any book of this branch"%></td>
<%end%>
</tr>
<%end%>
</tbody>
</table>
</div><!-- End of Computer Branch-->
但我不打結果在這裏輸出是什麼問題?
它是這樣顯示的。注意每行的長行。 編輯後,我得到這麼多。
確定這是什麼異常事情在終端
你可能會張貼你的CSS,假設你說的問題是與你的表瘋狂的線我相信問題是在CSS中。與類表和tablehover和那些(td,th,tr,tbody's)的子定義 – u8sand
實際上那些所有類都是twitter引導。他們剛纔提到要使用那些需要的類。 –
第31行需要<