I was wondering if there is some css/js magic that can prevent text from splitting vertically in the middle of a line. I'm using overflow:hidden in the below example. The text is not static ... it is rich-text entered by a user so I do not have control over the formatting.
i would like it to look like this:
Here's a possible example solution:
.dataTable td {
/* essential */
text-overflow: ellipsis;
width: 200px;
white-space: nowrap;
overflow: hidden;
/* for good looks */
padding: 10px;
}
via http://davidwalsh.name/css-ellipsis
Solution example: http://jsfiddle.net/4Fpq2/
This should at least provide a starting point.
Also, here are some additional possible solutions:
You can use wrapper div and multi-column css:
.wrapper {
-webkit-column-width: 150px; //You can't use 100%
column-width: 150px;
height: 100%;
}
Solution example: http://jsfiddle.net/4Fpq2/9/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With