CSS / HTML: Preventing line breaks of non-alphanumeric characters for word wrap?

Is there a way to prevent non-alphanumeric characters from breaking up words into HTML / CSS?

For example, in a table cell, if I have a row such as "--------", it will be split into two rows on the right edge of the cell, while "aaaaaaaa" will remain untouched and be transferred to the next row.

Edited to say: the best I've come up with so far is to wrap the text in the PRE tag, but this creates formatting and layout problems.

Thank,

Neil

+3
source share
1 answer

Use <nobr>or white-space:nowrap.

+3
source

Source: https://habr.com/ru/post/1769492/


All Articles