Code (Text): <div class="inside-content"> <p class="buttonheading" style="float:right;"></p> <div style="padding-top:20px; padding-right:10px; text-align:left; height:21px;"> <h2 class="contentheading"><a href="/press" class="contentpagetitle">Press and Praise</a></h2> </div> <div class='jootags'></div><br /> <br /> <div class='article-content'> <table cellpadding="5"> <tbody> <tr> <% @presses.each do |press| %> <tr> <td class="presses" width="186"> <div style="background-color: #f4f2d3; width: 186px;" class="presses"> <%= link_to press.publication_name, press.publication_url, :target => '_blank' %><br /> <%= press.date.strftime '%m.%d.%y' %> <br /><br /><em> <%= press.title %></em><br /></div> <div class="press_description"> <%= press.description %> </div><br/> <div class="read_article"> <%= link_to 'read article', press.url, :target => '_blank' %>» </div> </td> </tr> <tr> <td colspan="3"> <hr style="background-color: #c5c5c5; color: #c5c5c5; height: 2px;"> </td> </tr> <% end %> </tbody> </table> </div> <div style="clear:both;"></div> Right so. That's the index of the view of the Press page for a site called http://www.dailyworth.com/. Right now I'm working on making this page http://www.dailyworth.com/press into a dynamically loaded Rails page. But that's the easy part. What you see on the link I showed you is the live site, none of it is dynamic, it's all typed. Here is what I'm doing: Rails Version: Live Version: Right now, my problem is clearly that the tables are currently stacking. I've been racking my brains over this and I'm SURE it's fucking simple, I'm just tired and overworked right now. If anyone can post an altered code from above that lines the tables up from left to right, outputs 3 tables then starts a new row I'll give them 500k-1m np and +rep
I'm sure you were all wondering..... But here's what fixed it. Code (Text): <div class="inside-content"> <p class="buttonheading" style="float:right;"></p> <div style="padding-top:20px; padding-right:10px; text-align:left; height:21px;"> <h2 class="contentheading"><a href="/press" class="contentpagetitle">Press and Praise</a></h2> </div> <div class='jootags'></div><br /> <br /> <div class='article-content'> <table id="press_table" cellpadding="5"> <tbody> <tr> <% @presses.each do |press| %> <td valign="top" class="press"> <div class="presses"> <%= link_to press.publication_name, press.publication_url, :target => '_blank' %><br /> <%= press.date.strftime '%m.%d.%y' %> <br /><br /><em> <%= press.title %></em><br /></div> <div class="press_description"> <%= press.description %> </div><br/> <div class="read_article"> <%= link_to 'read article', press.url, :target => '_blank' %>» </div> </td> <% end %> </tr> <tr> <td colspan="4"> <hr style="background-color: #c5c5c5; color: #c5c5c5; height: 2px;"> </td> </tr> </tbody> </table> </div> <div style="clear:both;"></div>
Well the HTML in my loop was slightly off, basically the loop was opening a new table row for each press_item instead of printing 3 in a row and then starting a new one. This was solved using the each.slice rails method.