ruby on rails - Twitter Bootstrap Dropdown in Table Data Cell -
my view shows table of products returned in search, respective details, vendors sell products, , associated price. i'm trying put vendors , price in dropdown, rather have 2 data cell have 5+ vendors , prices distorting table row height. possible? best approach? i've looked @ using list, not sure how both price , vendors in dropdown way. i'm using table within table (table inception), please let me know if think there's better way. here's current view:
<table> <tr class="search-table"> <td>product</td> <td>details</td> <td>brand</td> <td>id</td> <td>vendors</td> </tr> <% @search_res.each |item| %> <tr class="search-table"> <td><%= item.product %></td> <td><%= item.details %></td> <td><%= item.brand %></td> <td><%= item.id %></td> <td> <table> <tr> <% item.vendors.each |vendor| %> <td><%= vendor.name %></td> <% end %> </tr> <tr> <% item.inventory_items.each |product| %> <td><%= product.price %></td> <% end %> </tr> </table> </td> </tr> <% end %> </table>
thanks in advance!
i think there's errors in markup worthy mentioned before all:
- your css class "search-table" possibly not assumed applied table's row:
<tr class="search-table">
header row semantically better wrap in "thead" tag , columns in row markup "th" tag:
<thead> <tr class="search-table"> <th>product</th> <th>details</th> <th>brand</th> <th>id</th> <th>vendors</th> </tr><thead>
on matter of question, think using bootstrap framework , dropdowns wouldn't convienient. imho collapsible elements make trick of show of info. wrap collpsible divs table's cell, that: http://jsfiddle.net/aizekazimov/9lhw2/
hope it'll help
Comments
Post a Comment