Search code examples
htmlcssword-break

Prevent numbers from breaking on 1000 separator


There's a table in a HTML file. The word-break CSS attribute indicates that long words have to break inside that table. I want only long texts (and not numbers) to break. I have some numbers, which have 1000 separators (every three digits, there's a comma). Those numbers break, too.
Is there any way to prevent those numbers from breaking ?


Solution

  • Use <span style="white-space: nowrap;">Content</span>. Alternatively, wrap your numbers inside a <nobr>-tag, note that this tag is not a standard though!