https://heald.nga.gov/mediawiki/index.php?title=Template:Nowrap/doc&feed=atom&action=historyTemplate:Nowrap/doc - Revision history2024-03-29T11:02:05ZRevision history for this page on the wikiMediaWiki 1.35.2https://heald.nga.gov/mediawiki/index.php?title=Template:Nowrap/doc&diff=293&oldid=prevEmily Pugh: 1 revision2012-04-18T15:47:29Z<p>1 revision</p>
<p><b>New page</b></p><div>{{Documentation subpage}}<br />
<br />
{{high-risk|500,000+}}<br />
<br />
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --><br />
<br />
{{tlx|Nowrap}} stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces or hyphens ("-"). The size of the nowrapped text becomes the minimum width of that paragraph. Before you use this template you might want to read up on [[Wikipedia:Line break handling]].<br />
<br />
===Usage===<br />
<br />
:: <code>{&#123;nowrap|these words stay together}}</code><br />
:: <code>{&#123;nowrap|a, b, c, or d.}}</code><br />
:: <code>{&#123;nowrap| merry-go-round }}</code><br />
:: <code><nowiki>{{nowrap| [[4-part harmony]] }}</nowiki></code><br />
<br />
The template names {&#123;[[Template:j|'''j''']]}} (join) or {&#123;[[Template:nobr|nobr]]}} or {&#123;[[Template:Nobreak|nobreak]]}} may be used instead of "nowrap", as they are redirects to {&#123;nowrap}}.<br />
<br />
=== Examples ===<br />
<br />
{| class=wikitable<br />
|"<code>They held <nowiki>{{nowrap|10 kg (22 lb)}}</nowiki> in total.</code>"<br />
<br/>May render like this:<br />
:They held {{nowrap|10 kg (22 lb)}}<br/>in total.<br />
<br/>Or like this:<br />
:They held<br>10 kg (22 lb) in total.<br />
<br/>But ''not'' render like this:<br />
:They held 10 kg (22 <br/>lb) in total.<br />
<br />
| "<code>He encountered <nowiki>{{nowrap|a tiger}}</nowiki> in the woods.</code>"<br />
<br/>May render like this:<br />
:He encountered a tiger<br/>in the woods.<br />
<br/>Or like this:<br />
:He encountered<br/>a tiger in the woods.<br />
<br/>But ''not'' like this:<br />
:He encountered a<br/>tiger in the woods.<br />
|}<br />
<br />
=== Handling equal-sign or bar ===<br />
<br />
[[Help:Template|Templates]] have problems with parameter data that contains [[equal-sign]]s "<code>=</code>" or vertical bars "<code>|</code>" (pipes). In such cases, consider using {{tl|nowrap begin}} + {{tl|nowrap end}} instead. But there are also other workarounds:<br />
<br />
For text that includes an equal-sign "=", precede the text with <code>1=</code>, use a triple-brace unnamed parameter <code><nowiki>{{{|=}}}</nowiki></code>, or the <code><nowiki>{{=}}</nowiki></code> template. For example:<br />
:<code><nowiki>{{nowrap|</nowiki>1=2 + 2 = 4}}</code>, <br /><code><nowiki>{{nowrap|2 + 2 {{{|=}}} 4}}</nowiki></code>, or <br /><code><nowiki>{{nowrap|2 + 2 {{=}} 4}}</nowiki></code><br />
<br />
which all render as this:<br />
:{{nowrap|1=2 + 2 = 4}}.<br />
<br />
For text that includes a vertical bar "|", escape the bar(s) with "<code><nowiki>&amp;#124;</nowiki></code>" or "<code><nowiki>{{!}}</nowiki></code>". For instance, put two bars "|6|" like this:<br />
:<code><nowiki>{{nowrap|</nowiki>&amp;#124;6&amp;#124; < 7}}</code> &nbsp;or&nbsp; <code><nowiki>{{nowrap|{{!}}6{{!}} < 7}}</nowiki></code><br />
<br />
Which renders this: <br />
:{{nowrap|&#124;6&#124; < 7}}<br />
<br />
=== Technical details ===<br />
<br />
The actual code that does the job is this HTML+CSS code:<br />
<br />
:<code><nowiki><span style="white-space:nowrap">This text will not wrap</span></nowiki></code><br />
<br />
Spaces at the beginning or end of the text will fall outside the no-wrap tag in the rendered text due to Wikimedia rendering mechanisms.<br />
<br />
The templates {{[[Template:j|j]]}}, {{[[Template:nobr|nobr]]}} and {{[[Template:Nobreak|nobreak]]}} redirect here.<br />
<br />
=== See also ===<br />
<br />
* {{tl|nowraplinks}} – Prevents wraps inside links and only allows wraps between the links and in normal text. Very useful for link lists and easy to use.<br />
* {{tl|nowrap begin}} – Prevents wraps in both text and links. For the trickier wrapping cases when you need full control, for instance in very complex link lists.<br />
* [[Wikipedia:Line break handling]] – The how-to guide detailing how to handle word wraps (line breaks) on Wikipedia. <br />
<br />
<includeonly><br />
<br />
<!-- ADD CATEGORIES AFTER THIS LINE --><br />
[[Category:Wikipedia formatting and function templates]]<br />
<br />
<!-- ADD INTERWIKIS AFTER THIS LINE --><br />
[[ar:قالب:لا لف]]<br />
[[bg:Шаблон:Nowrap]]<br />
[[da:Skabelon:Nowrap]]<br />
[[de:Vorlage:Nowrap]]<br />
[[et:Mall:Murdmata]]<br />
[[es:Plantilla:Nowrap]]<br />
[[fa:الگو:Nowrap]]<br />
[[fr:Modèle:Nobr]]<br />
[[he:תבנית:ללא גלישה]]<br />
[[hr:Predložak:Nowrap]]<br />
[[hsb:Předłoha:Nowrap]]<br />
[[hy:Կաղապար:Nowrap]]<br />
[[it:Template:Tutto attaccato]]<br />
[[ja:Template:Nowrap]]<br />
[[kl:Ilisserut:Nowrap]]<br />
[[ko:틀:Nobr]]<br />
[[no:mal:Nowrap]]<br />
[[pl:Szablon:Nowrap]]<br />
[[pt:Predefinição:Nowrap]]<br />
[[ro:Format:Nowrap]]<br />
[[ru:Шаблон:Nobr]]<br />
[[sv:Mall:Nowrap]]<br />
[[tpi:Template:Nowrap]]<br />
[[tr:Şablon:Nowrap]]<br />
[[uk:Шаблон:Nobr]]<br />
<br />
</includeonly></div>Emily Pugh