

By making text block float, IE7 rendered table cell correctly widthout any. Without white-space the table is 500px wide, and the text takes more than one line.īut white-space: nowrap makes the browser simply ignore the width directive and increase the width of the table until all data fits in one line. Today Im going to talk about a rarely used but extremely useful CSS property. Since I can't show you the code, I reproduced the problem: The whole table should have width: 100 to be as large as the device. However this doesn't work, maybe I'm missing something. Make text-overflow: ellipsis work inside a table cell CSS text-overflow in a table cell - Stack Overflow text-overflow ellipsis in table-cell without. Html text-overflow: ellipsis in table-cell without width. Both answers say to use white-space: nowrap. In fact my question is exactly similar to the first one, but since the link is dead I can't study it.

When using word-break property you have two options how to wrap it: break-all - this will break text once the characters don’t fit inside the container. What I need is an ellipsis after 15 characters, or so. This approach is handy when you don’t have to worry about text spanning multiline. Exemple using CSS table and table-cell: Lorem ipsum dolor sit amet, consectetur adipiscing elit.

I have a table of users where each row contains their names, e-mail address, and such. One way to handle long text in CSS is to wrap it to the next line. How to get text-overflow ellipsis working on a table cell If you’re looking for a way to clip a long text inside a table cell with an ellipsis, instead of wrapping to multiple lines, here’s some useful trick working on IE8+.
