Positioning a DIV at the top of a table cell

Status
Not open for further replies.

The SEO Hippy

Banned
Aug 5, 2006
33
1
0
I'm trying to position a DIV at the top of a table cell. Here's an example:
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%"><div style="position: relative; top:0;">position me at the top</div></td>
    <td width="50%"><p>some<br>stuff<br>goes<br>here</p></td>
  </tr>
</table>
I've tried just about everything..
 


Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" style="position:relative"><div style="position: absolute; top:0;">position me at the top</div></td>
    <td width="50%"><p>some<br>stuff<br>goes<br>here</p></td>
  </tr>
</table>
or
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" valign="top"><div>position me at the top</div></td>
    <td width="50%"><p>some<br>stuff<br>goes<br>here</p></td>
  </tr>
</table>
 
kyleirwin said:
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" style="position:relative"><div style="position: absolute; top:0;">position me at the top</div></td>
    <td width="50%"><p>some<br>stuff<br>goes<br>here</p></td>
  </tr>
</table>
or
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" valign="top"><div>position me at the top</div></td>
    <td width="50%"><p>some<br>stuff<br>goes<br>here</p></td>
  </tr>
</table>

Thanks :rasta:
 
Status
Not open for further replies.