The best way to describe the issue would be by posting a jsFiddle, so here it is.
And a screenshot for reference:

I have to put a div containing something within a td element, which has some formatting and height. The div cannot disrupt the cell’s height but itself is a little bigger than line-height within the cell, so the whole row’s height rises. It can be seen as the difference in height between the upper and lower tables on the screenshot.
Positioning the div relatively and moving it upward doesn’t help. My question is – is it possible to somehow position the div in the exact same place as in my example but without affecting the table row’s height?
Absolute positioning works as expected but has some flaws – the contents of the table and other elements of my page can change and therefore maintaining the proper position of the div would require monitoring it’s parent with JavaScript which wouldn’t be a very practical solution.
Thanks everyone for any help.
You can achieve the effect you’re looking for by wrapping the
divinside the table cell with anotherdivwhich is relatively positioned. Then change yourdivto be absolutely positioned.For some reason, jsFiddle, isn’t loading for me right now, so here’s the code.
HTML
CSS