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).
精彩评论