I have a container div, and it needs to be positioned as relative. Inside that div, I have a table. I want to display an element inside one of the table cells as absolute, relative to the containing cell, but it gets positioned relative to the container div (I think).
See this jsFiddle.
How can I set this up so that the element gets positioned relative to the td?
Make the TD position:relative as well. Absolute elements are always positioned relative to their nearest relative parent.
Since tables and table related elements can be the odd ducks of the HTML element world due to their unique behavior, it may be more reliable to simply add an inner wrapper DIV around all the contents of the TD, and make that DIV relative instead.