2013-02-23 23 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>