davej Posted November 6, 2013 Share Posted November 6, 2013 If you want to have the option of absolute positioning inside table cells does it make sense to fill all the table cells with div's set to display:relative height:100%? Link to comment Share on other sites More sharing options...
Ingolme Posted November 6, 2013 Share Posted November 6, 2013 I think setting the position on the <td> element itself to relative should be enough. I haven't done the test myself, though, but I can't see why it wouldn't work. Link to comment Share on other sites More sharing options...
davej Posted November 6, 2013 Author Share Posted November 6, 2013 No, just setting the td to position relative doesn't make the inner elements reference their position to the td, and if I change the td to display:block or inline-block then of course the table goes crazy. Link to comment Share on other sites More sharing options...
Ingolme Posted November 6, 2013 Share Posted November 6, 2013 Hmm, I guess that you do need a <div> inside it then. You probably will have to set the width and height of that <div> in px or some other fixed unit, though. <td> elements are dynamic in size, so there's no "100%" to be referenced from. Link to comment Share on other sites More sharing options...
davej Posted November 7, 2013 Author Share Posted November 7, 2013 Well, it certainly is annoying that there seem to be so many different cases. Inside a block element it works but then there are something like 12 other different display types. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now