Using an overflow: hidden; and white-space:nowrap; - WITHOUT it affecting the size of a container
Posted on 2012-03-29
I have a web app. It's a Ruby-on-Rails app - but this is more of a CSS question...
I want it to have a table with collapsible cells that have text in them of various lengths. If the text is longer than the table cell - either before or after the table cell is collapsed to a specific length - I need the text to be hidden behind the edge of the cell.
I can do this - using a CSS with overflow: hidden; and white-space:nowrap;
Trouble is, the table cell - or whatever I put the text into - doesn't size the same - depending on the size of the text. Longer text makes the container much wider; shorter text doesn't.
Basically, the collapsible container doesn't act the same when it has overflow:hidden text in it.
Is there any way to force the container to behave the same?
Thanks in advance,