Template:Pad/doc View history

(Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE. --> ==Usage== Use {{tl|pad}} to insert a horizontally padding HTML {{tag|span...")
 
m (removed DraftLink)
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:


==Usage==
==Usage==
Use {{tl|pad}} to insert a horizontally padding HTML {{tag|span|open}} inline. The template takes one unnamed parameter; a width value specified in <code>[[Pixel|px]]</code>, <code>[[Em (typography)|em]]</code> or <code>[[x-height|ex]]</code> (other CSS units&nbsp;– in, cm, pc, pt&nbsp;– are supported as well, but not recommended, typically at 96dpi conversion ratio). The default is <code>1 em</code>.
Use {{tl|pad}} to insert a horizontally padding HTML {{tag|span|open}} inline. The template takes one unnamed parameter; a width value specified in <code>[https://en.wikipedia.org/wiki/Pixel px]</code>, <code>[https://en.wikipedia.org/wiki/Em_(typography) em]</code> or <code>[https://en.wikipedia.org/wiki/X-height ex]</code> (other CSS units&nbsp;– in, cm, pc, pt&nbsp;– are supported as well, but not recommended, typically at 96dpi conversion ratio). The default is <code>1 em</code>.


'''The result is the specified padding followed by an &amp;nbsp;''' ([[non-breaking space]]&nbsp;– at 100% font size (8pt), typically 3px wide in narrow fonts like Arial and Tahoma, 4px in wider fonts like Arial Black and Verdana).
'''The result is the specified padding followed by an &amp;nbsp;''' ([https://en.wikipedia.org/wiki/Non-breaking_space non-breaking space]&nbsp;– at 100% font size (8pt), typically 3px wide in narrow fonts like Arial and Tahoma, 4px in wider fonts like Arial Black and Verdana).


==Examples==
==Examples==
Line 11: Line 11:
* <code>Indenting 50px causes<nowiki><br />{{pad|50px}}</nowiki>this amount of space.</code>
* <code>Indenting 50px causes<nowiki><br />{{pad|50px}}</nowiki>this amount of space.</code>
''Produces:''
''Produces:''
* Indenting 50px causes<br />{{{{DraftLink}}|50px}}this amount of space.
* Indenting 50px causes<br />{{pad|50px}}this amount of space.


Width of a typical year-range in Arial font (4.8em plus an &amp;nbsp;):
Width of a typical year-range in Arial font (4.8em plus an &amp;nbsp;):
* <code>1492–1540 Exploration by<nowiki><br />{{pad|4.8em}}</nowiki>Columbus & others.</code>
* <code>1492–1540 Exploration by<nowiki><br />{{pad|4.8em}}</nowiki>Columbus & others.</code>
''Produces:''
''Produces:''
* 1492–1540 Exploration by<br />{{{{DraftLink}}|4.8em}}Columbus & others.
* 1492–1540 Exploration by<br />{{pad|4.8em}}Columbus & others.




Line 22: Line 22:
* <code>1111–1117 Exploration by<nowiki><br />{{pad|4.4em}}</nowiki>Explorer Bob.</code>
* <code>1111–1117 Exploration by<nowiki><br />{{pad|4.4em}}</nowiki>Explorer Bob.</code>
''Produces:''
''Produces:''
* 1111–1117 Exploration by<br />{{{{DraftLink}}|4.4em}}Explorer Bob.
* 1111–1117 Exploration by<br />{{pad|4.4em}}Explorer Bob.


 
Spacing is, of course, different between fonts, too
Spacing is, of course, different between fonts, too:
* {{Font|This is text 0123456789 in Arial<br />{{{{DraftLink}}|100px}}and this is indented by 100px + 1 &amp;nbsp;<br />{{Pad|9em}}and this is indented by 9em + 1 &amp;nbsp;|font=Arial}}
* {{Font|This is text 0123456789 in Times New Roman<br />{{{{DraftLink}}|100px}}and this is indented by 100px+ 1 &amp;nbsp;<br />{{Pad|9em}}and this is indented by 9em + 1 &amp;nbsp;|font=Times New Roman}}
* {{Font|This is text 0123456789 in Arial Black<br />{{Pad|100px}}and this is indented by 100px + 1 &amp;nbsp;<br />{{{{DraftLink}}|9em}}and this is indented by 9em + 1 &amp;nbsp;|font=Arial Black}}
* {{Font|This is text 0123456789 in Lucida Console<br />{{Pad|100px}}and this is indented by 100px+ 1 &amp;nbsp;<br />{{{{DraftLink}}|9em}}and this is indented by 9em + 1 &amp;nbsp;|font=Lucida Console}}


''Note: 1em is typically 11.2px at 100% font size (8 point), 21.3px at 200% font size (16 point), and 32px at 300% font size (24pt).''
''Note: 1em is typically 11.2px at 100% font size (8 point), 21.3px at 200% font size (16 point), and 32px at 300% font size (24pt).''
 
<includeonly>
| <!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
<!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
[[Category:Inline spacing templates]]
[[Category:Inline templates]]
}}</includeonly>
[[Category:Typing-aid templates]]
/includeonly>

Latest revision as of 21:11, 6 December 2018

This is a documentation subpage for Template:Pad.
It contains usage information, categories and other content that is not part of the original template page.

Usage

Use {{pad}} to insert a horizontally padding HTML <span> inline. The template takes one unnamed parameter; a width value specified in px, em or ex (other CSS units – in, cm, pc, pt – are supported as well, but not recommended, typically at 96dpi conversion ratio). The default is 1 em.

The result is the specified padding followed by an &nbsp; (non-breaking space – at 100% font size (8pt), typically 3px wide in narrow fonts like Arial and Tahoma, 4px in wider fonts like Arial Black and Verdana).

Examples

Indenting by 50 pixels plus an &nbsp; (53px in Arial):

  • Indenting 50px causes<br />{{pad|50px}}this amount of space.

Produces:

  • Indenting 50px causes
     this amount of space.

Width of a typical year-range in Arial font (4.8em plus an &nbsp;):

  • 1492–1540 Exploration by<br />{{pad|4.8em}}Columbus & others.

Produces:

  • 1492–1540 Exploration by
     Columbus & others.


However, some digits supposedly require less space:

  • 1111–1117 Exploration by<br />{{pad|4.4em}}Explorer Bob.

Produces:

  • 1111–1117 Exploration by
     Explorer Bob.

Spacing is, of course, different between fonts, too

Note: 1em is typically 11.2px at 100% font size (8 point), 21.3px at 200% font size (16 point), and 32px at 300% font size (24pt).