angularjs binding nbsp entity doesnt work in IE
-
20-12-2019 - |
Question
I'm using ng-bind-html in a table cell and I want the cell not to collapse when the binded value is an empty string ('').
So I bind to: value || ' '
This works well on Crome and FF but fails on IE. If I check the source code on IE, it appears as a white-space.
Here's my fiddle showing this bug:
Thanks
Solution
It is a CSS style issue:
Try this:
table td{
border:1px solid;
white-space: pre;
}
Here is a sample fiddle:
What white-space: pre
does is to preserved whitespace.
Here is the documentation associated with this issue:
http://msdn.microsoft.com/en-us/library/ie/ms531182(v=vs.85).aspx
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow