If you want to preserve whitespace within an HTML element (div/span) without using non-breaking spaces (and therefore breaking word-wrap), add the following property to the CSS style(s) for that element:
white-space:pre-wrap;
There are more options available for this property as well:
Cool! Saved my time.
Thanks. Really helped me good time.
Thanks! This is really helpful. At first I thought I had problems with ColdFusion not reading the spaces from the DB, then I thought it may have been the DB, when all along it was HTML rules!!
Thanks. Really helpful. 🙂
I love canon, I still get so much use out of my 1d classic
This website said pre-wrap is not recognized by IE (http://www.htmldog.com/reference/cssproperties/white-space/). Unfortunately, I am working on IE. Any suggestion? Thanks.
Looks like this might help you out: http://stackoverflow.com/a/4413129