Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Top Left values of TD ? 1

Status
Not open for further replies.
Feb 2, 2005
21
0
0
US
Greetings,

I have a table. One of the cells has a valign="bottom" and some text.
Is there a way to put a <div> in the top left corner of the cell without changing the alignment of the cell itself. So that the div is up at the top and the text is still at the bottom.

If I use top=0px the div is of course placed at 0px of the whole page. I need to place it at 0px of the TD.

Thank you for any information.
Dave
 
You would position the div absolutely in the top left corner while the td has to be positioned. Absolutely positioned elements are positioned relative to their first positioned parent. If none exists, they are positioned according to the viewport. If you position your td (position: relative; will preserve it in the same place), you can position your div according to the td.
 
Vragabond you have saved my hair from being pulled out!

I had forgotten that I could use the in-line within the TD tag.

Here is what I ended up with:
In the <head> I set an ID selector as

#test {color: green; position: relative;}

Then in the TD itself I put this:

<td style="position: relative" bgcolor="black" align="left" valign="bottom" width="320" height="285">
<font color="white">
<div id="test">
here's the top test
</div>
here's the bottom test and if I keep going it goes here and perhaps I need a little more so I'm just going to keep typing
just to see if I can make the thing fill up or offset
</td>

Thank you!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top