0

I've been working on this site a lot lately, because I really want to get it done, but sadly I just keep getting problem after problem. So this time, I set up the div perfect, but when you are on a lower resolution, the div decides to move down. I don't understand it. If I zoom in it happens. Or if I zoom out on a low resolution, it's perfect.

The CSS:

#states{
    float:left;
    background-color:#EEEEEE;
    overflow: auto;
    display:inline-block;
    font-size:14;
}

#container{
    position:relative;
    margin-bottom:40%;  
    margin-left:11%;
}

#index{
    float:left;
}

The HTML:

<table width="100%" align="center" border="1" cellspacing="1" cellpadding="5">
    <tr>
        <td width="100%" valign="top">
            <?php states(); ?>
            <div id="container">
            <!--Start Content-->
            <div id="index">
            <table align="center" width="100%" class="test" border="0" cellspacing="1" cellpadding="15">
                <tr align="left">
                    <th>Posted</th>
                    <th>Title</th>
                    <th>Description</th>
                    <th>Location</th>
                    <th>User</th>
                </tr>
            </table>
            </div>
            <!--End Content-->
            </div>
        </td>
    </tr>   
</table>
John Conde
  • 217,595
  • 99
  • 455
  • 496
Nick Riggi
  • 49
  • 1
  • 5

1 Answers1

0

Maybe you should try a tableless approach.

is a DIV inside a TD a bad idea?

If you use a div in a td you will however get in a situation where it might be hard to predict how the elements will be sized.

Community
  • 1
  • 1
rlcabral
  • 1,496
  • 15
  • 39