2013-02-23 27 views
-4

我的index.html.erb不使用Twitter的引導樣式。這個表格在沒有引導的情況下顯得非常難看,因爲bootstraps zebra-striped類顯然不被識別。html.erb不使用引導樣式

但在我看來,其他文件都非常自舉,所以這個問題是這樣的一小段代碼(由this question啓發)

爲何如此之內?

<table class="zebra-striped"> 
    <tr> 
    <th>Name </th> 
    </tr> 

<% @students.each do |student| %> 
    <tr> 
    <td><%= student.name %></td> 
    </tr> 
<% end %> 
</table> 

的Gemfile:

gem 'bootstrap-sass', '2.1' 
gem 'sass-rails', '~> 3.2.3' 
+0

我不明白爲什麼這不是一個真正的問題。也許不是一個好的問題,但很清楚要問什麼。 – Sadik 2014-02-08 19:34:41

回答

1

閱讀的文檔將有助於標記的問題 http://twitter.github.com/bootstrap/base-css.html#tables

你也應該標記你的表多一點的標準。

<table class="table table-striped"> 
    <thead> 
    <tr> 
    <th>Name </th> 
    </tr> 
    </thead> 

    <tbody> 
    <% @students.each do |student| %> 
    <tr> 
     <td><%= student.name %></td> 
    </tr> 
    <% end %> 
    </tbody> 
</table>