Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 使用引导对齐不同行上的多个表_Css_Ruby On Rails_Twitter Bootstrap - Fatal编程技术网

Css 使用引导对齐不同行上的多个表

Css 使用引导对齐不同行上的多个表,css,ruby-on-rails,twitter-bootstrap,Css,Ruby On Rails,Twitter Bootstrap,我正在使用Twitter Bootstrap 2,在让表对齐方面遇到了一些问题 我在Rails应用程序中有一个视图,其中我想显示4个表-每行2个表(2 x 2),如下所示: | table || table | | table || table | <% @most_popular_articles.in_groups_of(2).each do |article_array|%> <div class="row">

我正在使用Twitter Bootstrap 2,在让表对齐方面遇到了一些问题

我在Rails应用程序中有一个视图,其中我想显示4个表-每行2个表(2 x 2),如下所示:

|   table   ||  table   |
|   table   ||  table   |
<% @most_popular_articles.in_groups_of(2).each do |article_array|%>
    <div class="row">
        <% article_array.each do |article| %> 
            <div class="span5">
                <table class="table table-hover">
                  <thead>
                    <tr>
                      # header names
                    </tr>
                  </thead>
                  <tbody>
                    <% user.each do |user| %>
                      <tr>
                        # field values
                      </tr>
                    <% end %>
                  </tbody>
                </table>
              </div>
            <div class="span1"></div>
                <%end%>
        </div>
<%end%>
相反,我得到的是:

|   table   ||  table   |
         |   table   |
|  table   |
前两个表按照我想要的方式对齐,但是第三个表没有正确地水平对齐,我不知道为什么

# view
<div class="container">    
  <div class="row">
    <%= render :partial=>"article_count", :locals=>{:most_popular_articles=>@most_popular_articles}%>
  </div> 
</div>

# _article_count
<% @most_popular_articles.each do |article| %>
  <div class="span5">
    <table class="table table-hover">
      <thead>
        <tr>
          # header names
        </tr>
      </thead>
      <tbody>
        <% user.each do |user| %>
          <tr>
            # field values
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <div class="span1"></div>
<% end %>
#查看
“文章数量”,:locals=>{:most\u popular\u articles=>@most\u popular\u articles}%>
#_物品_计数
#标题名称
#字段值

下面是一个示例,您可以看到它的外观,以及呈现的完整CSS和HTML。

尝试以下操作:

|   table   ||  table   |
|   table   ||  table   |
<% @most_popular_articles.in_groups_of(2).each do |article_array|%>
    <div class="row">
        <% article_array.each do |article| %> 
            <div class="span5">
                <table class="table table-hover">
                  <thead>
                    <tr>
                      # header names
                    </tr>
                  </thead>
                  <tbody>
                    <% user.each do |user| %>
                      <tr>
                        # field values
                      </tr>
                    <% end %>
                  </tbody>
                </table>
              </div>
            <div class="span1"></div>
                <%end%>
        </div>
<%end%>

#标题名称
#字段值