Контейнер HTML ERB таблицы разрывается после первых нескольких итераций - PullRequest
0 голосов
/ 22 ноября 2018

Метка фильтра div, которая у меня есть, прерывается на третьей итерации product.name;Я работаю с набором вложенных таблиц, и div по существу заканчивается на итерации № 3 и расширяет таблицу до ширины полного окна.Я использовал этот класс css в других контейнерах отчетов, и это первая проблема, с которой я столкнулся (только 2 вложенных таблицы в этих случаях).Я что-то упускаю особенно очевидное?

Вся мысль внутри <div class="col-md-12 material report">

<div class="filter-label">
    <h2>Report</h2>
    <table class="table table-striped">
        <% @warehoused_products.order(:name).each do |product|%>
        <tr>
            <td><h3><%= product.name%></h3></td>
        </tr>

        <tr>  
            <td>
                <%product.rfid_tags.each do |rfidt| %>
                    <table class="table table-striped" style="margin-bottom: 0px; table-layout: fixed; width:100%">
                    <thead>
                        <% @tag_attributes.each do |attribute| %>          
                        <th scope="col" class="attribute-header">
                        <%= attribute[:label]%></th>
                        <% end %>                                    
                    <thead>

                    <tr>
                        <td style="width: 20%"><%= rfidt.short_number %></td>
                        <td style="width: 20%"><%= humanize_seconds(rfidt.product_selections.sum(:use_time)) %></td>
                    </tr>     
                    <div class="collapse">
                        <% if rfidt.product_selections.empty? %>
                            <h4 class="subtle-header">No Recorded Uses</h4>
                        <% else %>
                        <table class="table table-striped" >
                            <thead>
                                <% @history_attributes.each do |attribute| %>          
                                <th scope="col" class="attribute-header">
                                <%= attribute[:label]%></th>
                                <% end %>                                    
                            <thead>

                            <tbody > 
                                <% rfidt.product_selections.order(created_at: :desc).each do |product_selection| %>
                                    <tr>
                                        <td>
                                        <% if product_selection.try(:rfid_tag) %> 
                                            <%= link_to product_selection.rfid_tag.try(:short_number), [@account, product_selection.rfid_tag], style: 'color: inherit;' %> 
                                        <% elsif RFIDTag.only_deleted.where( id: product_selection.rfid_tag_id ).first %>
                                            <%= RFIDTag.only_deleted.where( id: product_selection.rfid_tag_id ).first.short_number %> [DEL]
                                        <% else %>
                                            N/A
                                        <% end %>
                                        </td>
                                        <td>
                                        <% if product_selection.try(:listing).nil? %>
                                            [Deleted] 
                                        <% else %> 
                                            <%= link_to product_selection.try(:listing).try(:identify), [@account, product_selection.try(:listing)], style: 'color: inherit;' %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <% if product_selection.room_id.present? %>
                                            <% if product_selection.try(:listing).nil? || product_selection.try(:room).nil? %>
                                            [Deleted]
                                            <% else %>
                                            <%= link_to product_selection.try(:room).try(:identify), [@account, product_selection.try(:listing), product_selection.try(:room)], style: 'color: inherit;' %>
                                            <% end %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <%= product_selection.readable_state %>
                                        </td>          
                                        <td>
                                        <% unless product_selection.selected_at == nil %>
                                            <%= Time.zone.at( product_selection.selected_at ).strftime('%l:%M %p on %D') %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <% unless product_selection.staging_at == nil %>
                                            <%= Time.zone.at( product_selection.staging_at ).strftime('%l:%M %p on %D') %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <% unless product_selection.staged_at == nil %>
                                            <%= Time.zone.at( product_selection.staged_at ).strftime('%l:%M %p on %D') %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <% unless product_selection.destaging_at == nil %>
                                            <%= Time.zone.at( product_selection.destaging_at ).strftime('%l:%M %p on %D') %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <% unless product_selection.destaged_at == nil %>
                                            <%= Time.zone.at( product_selection.destaged_at ).strftime('%l:%M %p on %D') %>
                                        <% end %>
                                        </td>
                                        <td>
                                        <%= humanize_seconds(product_selection.use_time) %>
                                        </td>
                                    </tr>
                                <% end %>
                            </tbody>
                        </table>
                        <% end %>
                    </div>
                </table>
            </td>

            </table>

              <% end %>
            </td>
        </tr>
        <%end%>  
    </table> 
</div>
...