Reputation: 1051
I am trying to fit a long string which can optionally contain dash(-).
When it contain dashes it should hyphen at these dashes.
I tried word-break: break all;
but it does not break it at hyphens.
Is there any way to achieve my goal in a pure css?
An example: https://jsfiddle.net/5gyzv7cn/1/
Upvotes: 2
Views: 35
Reputation: 3994
You should use break-word
, this will break the string at dashes if exists.
I've added:
td {
word-break: break-word;
}
See JSfiddle: https://jsfiddle.net/hatufvy1/11/
Upvotes: 1