tags:

views:

3

answers:

1

Is there a way to prevent a string of non-alphanumeric characters from being split by word wrapping in HTML/CSS?

For example, in a table cell, if I have a string such as '--------', it will be split over two lines at the right-hand edge of the cell, whereas 'aaaaaaaa' will remain intact and be pushed onto the next line.

Edited to say: the best I've come up with so far is to wrap the text in a PRE tag but that creates formatting/layout problems of it's own.

Thanks,

Neil

+2  A: 

Use <nobr> or white-space:nowrap.

Ignacio Vazquez-Abrams
Ah! It was the simple fact that I was using the hyphen character that was throwing me off. Thanks Ignacio.