开发者

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

开发者 https://www.devze.com 2023-01-09 10:14 出处:网络
I have a div inthe html and after the Divand I have another div which contains theHTml table Which is coming on the top ofdiv. 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

精彩评论

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

关注公众号