I'm trying to absolute position a p element inside a table. I tried to make <td> have position relative but it doesn't seem to work.

<td style="position:relative;">
<p style="position:absolute; bottom:0px;"
</td>

Does not work! But this does..

<td>
<div style="position:relative";>
<p style="position:absolute; bottom:0px;"> Success </p>
</div>
</td>

I'm confused why td cant be relative and if using a DIV to absolute position elements inside a <td> is the only option?

Dat0,

I think you will find that css position is inhibited from being applied to table cells because it would at least potentially cause confict/ambiguity with regard to the layout of the rest of the table. After all, TDs are by definition block-like elements that are positioned relative to their neighbours.

However, as you have discovered that the contents of table cells can be relatively/absolutely positioned.

I think you have come up with a good solution.

Airshow

Thank you. solved.

thanks i also got off on this one!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.