Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Spaces

Permanently protected template
From Wikipedia, the free encyclopedia
(Redirected fromTemplate:Nbsp)

 

Template documentation[view] [edit] [history] [purge]
iconThis templateshould not be used incitation templates such asCitation Style 1 andCitation Style 2, because it includes markup that will pollute theCOinS metadata they produce; seeWikipedia:COinS.
This templateshouldnot besubstituted.
WarningThis template is used onapproximately 698,000 pages, or roughly 1% of all pages.
To avoid major disruption and server load, any changes should be tested in the template's/sandbox or/testcases subpages, or in your ownuser subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on thetalk page before implementing them.
This template usesLua:

A template used to insert one or morenon-breaking spaces ( ) to prevent automatic line breaks at specific points in the text. This is useful for keeping elements such as numbers and units together.

Usage

Syntax

{{spaces|N|type}} producesN consecutive non-breaking spaces (whereN is awhole number larger than zero) of the type specified by the second parameter (which are ordered by decreasing space width):em,fig,en,thin,hair. If type is not specified,N non-breaking spaces ( ) are produced. A non-breaking space has the same width as a standard space, whose width is between the width ofen andthin.

{{spaces|type}} produces a single non-breaking space of the type indicated.

Controlling line-breaking in infoboxes

This template, usually as its alias{{nbsp}}, may be used with{{wbr}} and{{nowrap}} to control line-breaking in bulletless lists in infoboxes, to prevent wrapped long entries from being confused with multiple entries. SeeTemplate:Wbr/doc#Controlling line-breaking in infoboxes for details.

Comparisons

Name
(alias)
InstanceExample code and ...Using{{spaces}}OutputOutput{{spaces}}
noneText<ref>...</ref>
''Text''<ref>...</ref>
Text[1]
Text[2]
Hair
(Very thin)
Text{{hair space}}<ref>...</ref>
''Text''{{hair space}}<ref>...</ref>
Text{{spaces|hair}}<ref>...</ref>Text [1]
Text[2]
Text[1]
Text[2]
2-pixelText{{px2}}<ref>...</ref>
''Text''{{px2}}<ref>...</ref>
Text[1]
Text[2]
Narrow no-breakText{{narrow no-break space}}<ref>...</ref>
''Text''{{narrow no-break space}}<ref>...</ref>
Text [1]
Text[2]
ThinText{{thin space}}<ref>...</ref>
''Text''{{thin space}}<ref>...</ref>
Text{{spaces|thin}}<ref>...</ref>Text[1]
Text[2]
Text[1]
Text[2]
Standard[a] Text&nbsp;<ref>...</ref>
''Text''&nbsp;<ref>...</ref>
Text{{spaces}}<ref>...</ref>Text [1]Text [1]
Text [2]
En1&ensp;31{{spaces|en}}31 313
Figure123<br/>1&numsp;3123<br/>1{{spaces|fig}}3123
1 3
123
13
Em1&emsp;31{{spaces|em}}31 313
  1. ^Provided here by anon-breaking space (&nbsp;).


Template data

This is theTemplateData for this template used byTemplateWizard,VisualEditor and other tools.See a monthly parameter usage report forTemplate:Spaces in articles based on its TemplateData.

TemplateData for Spaces

Inserts one or more non-breaking spaces

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Quantity1

How many non-breaking spaces to insert

Default
1
Numberoptional
Type2

Non-default types (in decreasing order of width): em, fig, en, thin, hair

Suggested values
emfigennbspthinhair
Default
&nbsp;
Stringoptional

See also

Non-breaking space characters
Breaking space characters
Non-character spaces
The abovedocumentation istranscluded fromTemplate:Spaces/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Spaces&oldid=687408551"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp