Jump to content

max-width inside table cell


Jwtlm

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...