开发者

Table coming on the Top of Div; how to bring the Table down

I have a div in the html and after the Div and I have another div which contains the HTml table Which is coming on the top of div. How to bring the table down.

<div id='testupdate2' >Mynumber: ". $num." </div>
<div id="test">
  <table cellspacing=0 cellpadding=0 border=0 width="100%">
      <tbody>
        <tr>
          <td id="Header" class="navUPD">MY number</td>
        </tr>
        <tr>
          <td id="tls" class="navUPD">MY DETAILS </td>
        </tr>
        <tr>
          <td id="mgmnt" class="nav开发者_开发百科OFFTDUPD"> ADDR. MGMT </td>
        </tr>            
   </tbody>
  </table>  
</div>

How to bring the table down to the DIV?


To push your table off the top of your <div id="test"> you can use CSS padding:

#test {
    padding-top: 20px;
}

Or alternatively:

#test table {
    padding-top: 20px;
}


If you have something else in <div id="test"> except that table and you want to table be always aligned to bottom of the div, you can do something like this in your CSS


#id{
  position: relative;
}
#id table{
  position: absolute; /*this is absolute to #id not to body tag*/
  bottom: 0px;
  left: 0px;
}

This should do the job, I think (I didn't check it).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜