1

Ok I'm having this really weird problem with my Drupal 7 site. I have edited my page.tpl.php file. Following is the html where this oddity occurs

<table class="main_content">
<tr>
    <td>
        <div class="left_main">
            <div class="main_title">
                 <h2 class="centerBoxHeading"><?php echo $title; ?></h2>

            </div>
            <?php print render($page['content']); ?>
        </div>
    </td>
    <td>
        <table>
               <tr>
                   <td>
                       <div class="right_main">
                           <div class="main_title">
                                <h2 class="centerBoxHeading">Bestselling</h2>
                           </div>
                           <?php print render($page['right']['views_bestsellers-block']); ?>
                       </div>
                   </td>
               </tr>
               <tr>
               <td>
                   <div class="other_blocks_right">
                       <div class="main_title">
                           <h2 class="centerBoxHeading">Poll</h2>
                       </div>
                       <?php print render($page['right']['poll_blocks_11']); ?>
                   </div></td>
               </tr>
        </table>
   </td>
</tr>
</table>

So far everything looks fine. But when opened in the browser print render($page['content']); prints outside the table before it! I have checked this through firebug.

I have also edited a node.tpl.php file and everything is fine inside it.

Can anyone suggest what is going on?

8
  • 1
    tables and div elements have different styles. that might be the problem.. better you use div elements.
    – Rafee
    Commented May 21, 2012 at 5:42
  • 1
    But using table is my requirement. Without it I can't seem to get my 'bestselling' and 'poll' blocks on the left. This is just weird, why wouldn't Drupal allow this? Commented May 21, 2012 at 5:46
  • 1
    why dont you override CSS on/with table and div
    – Rafee
    Commented May 21, 2012 at 5:50
  • 2
    In what way do I override the CSS? Commented May 21, 2012 at 5:51
  • 1
    Two ways: Inline styling, where you need to write the css in inline the element tags. Javascript when page loads, change the css you want to display.. Its better to use inline styling, cos it renders before the page loads. and javascript will change the styling after page load..
    – Rafee
    Commented May 21, 2012 at 5:59

1 Answer 1

2

The content in my node.tpl.php was wrapped in a tr tag. Don't know how it got there. When I removed it everything was fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.