Forum Moderators: not2easy

Message Too Old, No Replies

Vertical align a table inside a DIV using css

Vertical align a table inside a DIV using css

         

sfomra

10:11 pm on Jul 26, 2006 (gmt 0)

10+ Year Member



am tryin to vertically align a table enclosed inside a div to the bottom of the div. the html code looks something like this

<div id="div1" class="div_cell" style="width:150px; height:150px">
<table id="table1" class="section_A">
<tr>
<td>
<img id="image1" src="/images/1223.jpg" alt="">
</td>
</tr>
</table>
</div>

now my objective is to vertically align the table (table1) to the middle/bottom/top of the div (div1).

i have tried lots of stuff but with no success.... hope someone can help me out on this.

duncan biscuits

6:16 pm on Jul 29, 2006 (gmt 0)

10+ Year Member



table#table1{margin-top:0;}
should work. Use
margin-top:0 auto;
if you also want the table centered.