SVG text element with whitespace not preserved in IE
If you are using d3 this works well:
.attr("style","white-space:pre")
I guess you could replace each space by  
(that's the unicode non-breaking space character).
In javascript it would be written as \u00A0 though.