Search code examples
phphtml-tablesmarty

Firefox change table layout


I am having problem in fix layout of categories of video in firefox it works normally in google chrome but in firefox the table which is align center is leave its place and make horizontal scroll bar enable it need some expert hand in smarty I am showing the smarty coding please guys help me yiu guys can also check Page Where Firefox Givin Prob.

Check this page in Google Chrome and in Firefox its works well in Chrome but not in Firefox please help me

<div align="center">
<table border="0" align="center">
{section name=i loop=$cat step=4 max=6} <!--ROWS EG change max=???-->
    <tr> 
{section name=cat loop=$cat start=$smarty.section.i.index max=4}<!-- COLUMNS EG change max=??? to the ammount and step=??? to the same ammount-->
    <td align="center"><a href="index.php?cat={$cat[cat].id}"><b>{$cat[cat].name}</b><br /><img border="0" width="153" height="120" src="{$cat[cat].picture}" {if $firefox eq "1"}class="reflect" alt="No Image Yet"{/if} /></a></td>
    {/section}
    </tr>
{/section}
</table>
</div>

Solution

  • Put br as first element inside your div:

    <div align="center">
       <br/>
       <table border="0" align="center">
       .
       .
    

    or you can add a clearer after your search section:

    .
    .
    </div>
    
    <div style="clear:both"></div>
    
    <div align="center">
    .
    .
    

    The reason why the issue occurred is because your search section's div, which is float to left, overlaps your second div and pushes the table. After adding a clearer, the first div has something to push instead of your table.