Template:Nbsp/doc

This template produces a non-breaking space. It is the same in appearance as a normal space, but treated as a letter in regards to line wrapping. The primary use of this is for writing units of measurement. Following the guidance of the SI Brochure, 9th edition, section 5.4.3:


 * The numerical value always precedes the unit and a space is always used to separate the unit from the number.

However, if a space is inserted between a number and unit, there is a possibility that the number and unit could be split by a line break, like so:

Notice that the "20mA" has been split between lines. Re-wording the sentence to move the position of "20mA" to an earlier or later point in the sentence is not an option, besides being inconvenient, because the position of line breaks will change depending on the device and window size.

The real solution is to use the non-breaking space space character, which is a space that is treated like other alphanumeric characters. This means the text-wrapping algorithm will avoid placing line breaks at that position. Below is the same example, but using a non-breaking space. This time, the entire "20 mA" is moved to the next line as a block, rather than be split apart:

Since standard keyboards don't have a non-breaking space key, this template was created to make insertion of non-breaking spaces easier. To place a non-breaking space using this template, type  in the article. For example, instead of typing, you would type.