Html help. 500 +rep

Discussion in 'World of SPAM' started by arcrutus, Nov 29, 2010.

  1. arcrutus

    arcrutus Level I

    Joined:
    Jun 28, 2010
    Messages:
    140
    Likes Received:
    2
    Code (Text):
    1. <div class="inside-content">           
    2. <p class="buttonheading" style="float:right;"></p>
    3. <div style="padding-top:20px; padding-right:10px; text-align:left; height:21px;">
    4.    
    5.     <h2 class="contentheading"><a href="/press" class="contentpagetitle">Press and Praise</a></h2>
    6.    
    7. </div> 
    8.  
    9.     <div class='jootags'></div><br />
    10.     <br />
    11.     <div class='article-content'>
    12.    
    13.     <table cellpadding="5">
    14.         <tbody>
    15.            
    16.     <tr>
    17.             <% @presses.each do |press| %>
    18.     <tr>
    19.             <td class="presses" width="186">
    20.            
    21.                 <div style="background-color: #f4f2d3; width: 186px;" class="presses">
    22.                 <%= link_to press.publication_name, press.publication_url, :target => '_blank' %><br />
    23.                 <%= press.date.strftime '%m.%d.%y' %> <br /><br /><em>
    24.                 <%= press.title %></em><br /></div>
    25.                
    26.                 <div class="press_description">
    27.                 <%= press.description %>
    28.                 </div><br/>
    29.                
    30.                 <div class="read_article">
    31.                 <%= link_to 'read article', press.url, :target => '_blank' %>&raquo;
    32.                 </div>
    33.                        
    34.             </td>  
    35.     </tr>
    36.    
    37.     <tr>
    38.                 <td colspan="3">
    39.                 <hr style="background-color: #c5c5c5; color: #c5c5c5; height: 2px;">
    40.             </td>
    41.     </tr>
    42.  
    43.             <% end %>
    44.    
    45.  
    46.         </tbody>
    47.     </table>
    48. </div> 
    49. <div style="clear:both;"></div>
    50.  
    51.    

    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:

    [​IMG]



    Live Version:

    [​IMG]


    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
     
  2. arcrutus

    arcrutus Level I

    Joined:
    Jun 28, 2010
    Messages:
    140
    Likes Received:
    2
    I'm sure you were all wondering.....


    But here's what fixed it.


    Code (Text):
    1. <div class="inside-content">           
    2. <p class="buttonheading" style="float:right;"></p>
    3. <div style="padding-top:20px; padding-right:10px; text-align:left; height:21px;">
    4.    
    5.     <h2 class="contentheading"><a href="/press" class="contentpagetitle">Press and Praise</a></h2>
    6.    
    7. </div> 
    8.  
    9.     <div class='jootags'></div><br />
    10.     <br />
    11.     <div class='article-content'>
    12.    
    13.     <table id="press_table" cellpadding="5">
    14.         <tbody>
    15.            
    16.     <tr>
    17.             <% @presses.each do |press| %>
    18.             <td valign="top" class="press">
    19.            
    20.                 <div class="presses">
    21.                 <%= link_to press.publication_name, press.publication_url, :target => '_blank' %><br />
    22.                 <%= press.date.strftime '%m.%d.%y' %> <br /><br /><em>
    23.                 <%= press.title %></em><br /></div>
    24.                            
    25.                 <div class="press_description">
    26.                 <%= press.description %>
    27.                 </div><br/>
    28.            
    29.                 <div  class="read_article">
    30.                 <%= link_to 'read article', press.url, :target => '_blank' %>&raquo;
    31.                 </div>
    32.                        
    33.             </td>  
    34.  
    35.             <% end %>
    36.     </tr>
    37.    
    38.     <tr>
    39.                 <td colspan="4">
    40.                 <hr style="background-color: #c5c5c5; color: #c5c5c5; height: 2px;">
    41.             </td>
    42.     </tr>
    43.    
    44.         </tbody>
    45.     </table>
    46. </div> 
    47. <div style="clear:both;"></div>
    48.  
     
  3. Shawn

    Shawn Level IV

    Joined:
    Jul 15, 2009
    Messages:
    1,989
    Likes Received:
    76
    Location:
    Somewhere, lah.
    What do you mean by stacking tables? I know this has been solved but I was just wondering.
     
  4. arcrutus

    arcrutus Level I

    Joined:
    Jun 28, 2010
    Messages:
    140
    Likes Received:
    2
    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.