No line-break after a hyphen
Try using the non-breaking hyphen ‑
. I've replaced the dash with that character in your jsfiddle, shrunk the frame down as small as it can go, and the line doesn't split there any more.
HTML no line break at hyphens
Use the non-breaking hyphen: ‑
How to prevent line break at hyphens in all browsers
I’m afraid there’s no simpler way to do it reliably than splitting the text to “words” (sequences of non-whitespace characters separated by whitespace) and wrapping each “word” that contains a hyphen inside nobr
markup. So input data like bla bla foo-bar bla bla
would be turned to bla bla <nobr>foo-bar</nobr> bla bla
.
You might even consider inserting nobr
markup whenever the “word” contains anything but letters and digits. The reason is that some browsers may even break strings like “2/3” or “f(0)” (see my page on oddities of line breaking in browsers).
Avoid line-breaks after hyphen in R Shiny
You can disable the wrapping by using the class nowrap
:
DT::datatable(
class = "display nowrap",
extensions = c('Buttons','Scroller'),
......
Is it possible to prevent linebreaks between hyphenated words in CSS?
Did you try using "non-breaking hyphen"? No CSS needed. It's a normal html entity.
Try this ‑
This is an example
Sample‑text
HTML Tables - How to make IE not break lines at hyphens
You are looking for the white-space
property, which affords you control over how white space and line-breaks affect the content of your element. To collapse white space sequences, but prevent line-breaks, you can use the nowrap
value:
.dates {
white-space: nowrap;
}
<td class="dates">2009-01-01</td>
Related Topics
Html/Css Triangle With Pseudo Elements
The Reference to Entity "Foo" Must End With the ';' Delimiter
Using Flex Order Property to Re-Arrange Items For Desktop and Mobile Views
Svgs Not Scaling Properly in Ie - Has Extra Space
Html5 - Canvas Element - Multiple Layers
Why Can't ≪Fieldset≫ Be Flex Containers
Why Does Overflow:Hidden Not Work in a ≪Td≫
What Characters Are Allowed in Dom Ids
What's the Difference If I Put CSS File Inside ≪Head≫ or ≪Body≫
Why Do Absolute Elements Stack Up on Each Other Instead of Stacking One After the Other
How to Ignore HTML Element from Tabindex
Html: Include, or Exclude, Optional Closing Tags
What's the Difference Between Disabled="Disabled" and Readonly="Readonly" for HTML Form Input Fields
How to Use Google Chrome 11'S Upload Folder Feature in My Own Code