Template:Spaces/doc: Difference between revisions

From Azupedia
Jump to navigation Jump to search
imported>Fire
No edit summary
 
No edit summary
 
Line 2: Line 2:
<!-- EDIT TEMPLATE DOCUMENTATION AFTER THIS LINE -->
<!-- EDIT TEMPLATE DOCUMENTATION AFTER THIS LINE -->
{{Template shortcut|&nbsp|nbs|nbsp|nbsp;|space|spcs}}
{{Template shortcut|&nbsp|nbs|nbsp|nbsp;|space|spcs}}
{{COinS safe|n}}
 
{{二次利用}}
{{二次利用}}
{{used in system}}
 
{{stack|{{Lua|Module:String}}}}<!--wider box than {{Template shortcut}}-->
{{stack|{{Lua|Module:String}}}}<!--wider box than {{Template shortcut}}-->


A template to produce one or more [[Wikipedia:non-breaking space|non-breaking space]]s (<code>&amp;nbsp;</code> character entities).
A template to produce one or more [[Wikipedia:non-breaking space|non-breaking space]]s (<code>&amp;nbsp;</code> character entities).


== Usage ==
== Usage ==  
=== Syntax ===
=== Syntax ===
{{larger|<code><nowiki>{{spaces|</nowiki>''N''{{!}}''type''<nowiki>}}</nowiki></code>}} produces ''N'' consecutive non-breaking spaces (where ''N'' is a [[Integer|whole number]] larger than zero) of the type specified by the second parameter (which are ordered by decreasing space width): <code>em</code>, <code>fig</code>, <code>en</code>, <code>thin</code>, <code>hair</code>. If type is not specified, ''N'' non-breaking spaces (<syntaxhighlight inline lang=xml>&nbsp;</syntaxhighlight>) are produced. A non-breaking space has the same width as a standard space, whose width is between the width of <code>en</code> and <code>thin</code>.
{{larger|<code><nowiki>{{spaces|</nowiki>''N''{{!}}''type''<nowiki>}}</nowiki></code>}} produces ''N'' consecutive non-breaking spaces (where ''N'' is a [[Integer|whole number]] larger than zero) of the type specified by the second parameter (which are ordered by decreasing space width): <code>em</code>, <code>fig</code>, <code>en</code>, <code>thin</code>, <code>hair</code>. If type is not specified, ''N'' non-breaking spaces (<syntaxhighlight inline lang=xml>&nbsp;</syntaxhighlight>) are produced. A non-breaking space has the same width as a standard space, whose width is between the width of <code>en</code> and <code>thin</code>.

Latest revision as of 08:02, 23 January 2023

A template to produce one or more non-breaking spaces (&nbsp; character entities).

Usage

Syntax

{{spaces|N|type}} produces N consecutive non-breaking spaces (where N is a whole 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 (&nbsp;) are produced. A non-breaking space has the same width as a standard space, whose width is between the width of en and thin.

{{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. See Template:Wbr/doc for details.

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for Spaces

Inserts one or more non-breaking spaces

Template parameters

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

Default
&nbsp;
Stringoptional

See also

Template:Inline spacing templates