I have found an issue when using absolutely positioned content within a td
element. The td
element is not being recognised as a positioned element so the content is being positioned relative to the body
. This issue is only in FireFox and the expected layout is visible in other browsers - jsfiddle.
Doing a little digging around it seems that the issue is related to FireFox using display:table-cell
as the default display type for table cells. I can resolve the issue by changing the display to block
or by adding a div
container to act as a positioned container to the content.
Is there any reason to avoid changing the display type of the cell to block
? I would prefer to use this method rather than adding additional elements to correct an issue in one browser.
This is not the same issue as described in either div style absolute in a table cell or Why "display: table-cell" is broken when "position: absolute".