Jwtlm Posted April 8, 2013 Share Posted April 8, 2013 There something which I don't really understand, I have the following code HTML snippet <div class="outer"><div class="inner">STUF SDF DFSD FDF SDFSDF SDSD FDSFDSF DF sdad asd ad asd asd ad asd das dsad sa dsa dasd sad asd assvdf dfasdf asdf ad fsafd DSF D F</div></div> and the following CSS .outer{ display:table; width:100%;}.inner { display:table-cell; max-width:200px; height:50px; background-color:silver; overflow:hidden; white-space:nowrap; text-overflow:ellipsis} If the calculated table width is longer than 200px for example 500px, then I would expect the inner div to stop at 200px and the content inside would also stop at 200px. But in reality the inner content actually stretches to the width of the table. Is this the correct behaviour? Thanks Link to comment Share on other sites More sharing options...
Ingolme Posted April 9, 2013 Share Posted April 9, 2013 Table cells always expand to contain the content. If you allow the <div> to be a block instead then that won't happen. Link to comment Share on other sites More sharing options...
Jwtlm Posted April 9, 2013 Author Share Posted April 9, 2013 Ah that makes sense. Thanks for your help 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