css - editable div in table exceeds its percentage-width when content is very long -


i'm using chrome. have editable div inside table, width defined percentage. css below.

div#editable {     width:20%;     white-space:nowrap;         overflow:hidden;     border:1px solid darkgrey; } 

when adding long content div, width begins increase regardless of css definition. here demo link: http://jsfiddle.net/k5erc/. can try input more content div , see width growing.

however, if width defined px or em, there no such problem.

could tell me how fix width? thanks!

if wish text wrap, width stays same need rid off white-space:nowrap; otherwise add table-layout:fixed; table css

see updated fiddle here http://jsfiddle.net/k5erc/1/


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -