Jump to content

Template talk:Space

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Examples

[edit]
 – Just a note.
 *abcdefghij
 *a{{space|1}}cdefghij
 *a{{space|2}}defghij
 *a{{space|3}}efghij
 *a{{space|4}}fghij

  • abcdefghij
  • a cdefghij
  • a  defghij
  • a   efghij
  • a    fghij

Genesis June 07, 2006

[edit]
Stale
 – This code is obsolete.

I ported this over from wikisource as {{indent}}. Seems useful for when a wikitable is contraindicated, yet one wants to line up several short columns of material. Indent can NOT be used in-line because of the leading '<br />'. This is at genesis the only difference between the two.

Displaying with nowikis:


{{ #switch: {{{1}}}
| 0 = 
| 1 = &emsp; 
| 2 = &emsp;&emsp; 
| 3 = &emsp;&emsp;&emsp; 
| 4 = &emsp;&emsp;&emsp;&emsp; 
| 5 = &emsp;&emsp;&emsp;&emsp;&emsp; 
| 6 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 7 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 8 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 9 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 10 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 11 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 12 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 13 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 14 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 15 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 16 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 17 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 18 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 19 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 20 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 21 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 22 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 23 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 24 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 25 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 26 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 27 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 28 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 29 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 
| 30 = &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 

| 
}}<noinclude>[[Category:Uncategorised templates]]</noinclude>

I suggested over there at wikisource that the category ought to be 'Pretty print' or the like, along the lines of a pretty print program or filter in Computer Science, esp. used in the bad old days for C, C++, etc.

Best regards, FrankB 21:33, 26 May 2006 (UTC)[reply]

Demo/Test

[edit]
Stale
 – This code is obsolete.
echoed from the commons... where something is broken.
  1. {{space|1}}... x y 1_ z
  2. {{space|2}}... x  y 2_ z
  3. {{space|3}}... x   y 3_ z
  4. {{space|4}}... x    y 4_ z
  5. {{space|5}}... x     y 5_ z
  6. {{space|6}}... x      y 6_ z
  7. {{space|7}}... x       y 7_ z
  8. {{space|8}}... x        y 8_ z
  9. {{space|9}}... x         y 9_ z
  10. {{space|10}}... x          y 10_ z
  11. {{space|11}}... x           y 11_ z
  12. {{space|12}}... x            y 12_ z

-apparently, something's also now broken here today too above '5'! // FrankB 15:59, 17 August 2006 (UTC)[reply]

Not clear

[edit]
Resolved
 – Template is properly documented now.

It is not clear what this is all about. What is the meaning of n spaces in a proportional font? In a non- proportional font, why not just use spaces, like

  99
 100
1234

Patrick 00:13, 18 August 2006 (UTC)[reply]

More

[edit]
Stale
 – No one seemed interested in multi-purposing the template.

I stumbled on this template thinking "Wouldn't it be nice to have some template which produces a thin space, an en space or an em space without having to type the whole "{{unicode|&..." out? What should I call it ..."

Lo & behold the template already existed but with a different purpose ... though it's not as if its a vastly different purpose. Now, here's what I have in mind. Let's have this as a dual purpose template. Instead of my going and making a whole new template (and call it what?) let me add to this one. Here's what I'm thinking of adding (into the "").

|thin={{unicode|&thinsp;}}
|th={{unicode|&thinsp;}}
|t={{unicode|&thinsp;}}
|en={{unicode|&ensp;}}
|n={{unicode|&nsp;}}
|em={{unicode|&emsp;}}
|m={{unicode|&emsp;}}

I don't think that this will cause confusion or detract in any other way from the template. Note: I've given alternatives (e.g. "thin", "th" or just "t")—why not? It only makes things easier to use. Jɪmp 08:41, 20 June 2007 (UTC)[reply]

Six of one ≠ half a dozen of the other

[edit]
Unresolved
 – Display issues remain; replacement code provided at /sandbox.

What do twelve spaces look like using this template?

]            [ 12 {{space|1}}s
]            [ 6 {{space|2}}s
]            [ 4 {{space|3}}s
]            [ 3 {{space|4}}s
]            [ 2 {{space|6}}s
]            [ 1 {{space|12}}
  • ]    [
  • ]  [

The template is using a mix of ordinary spaces non-breaking spaces and em spaces thus we've got this strange disproportionality. {{space|2}}, for example, is not twice but (about) four times the width of {{space|1}}. Is there a purpose to this? Jɪmp 18:06, 21 June 2007 (UTC)[reply]

Protection template

[edit]
Resolved
 – Done.

{{editprotected}} Please add the protection template to this template inside the <noinclude>...</noinclude> tags at the end, not to its documentation page. The reason I removed it from there is because that documentation page is used for other, non-protected, templates as well and caused an error there. Thank you. Debresser (talk) 12:17, 5 May 2009 (UTC)[reply]

 Done. — Martin (MSGJ · talk) 12:45, 5 May 2009 (UTC)[reply]
Thanks. Debresser (talk) 12:56, 5 May 2009 (UTC)[reply]

Default

[edit]
Unresolved
 – Still not in template; new code at /sandbox fixes this.

{{editprotected}} Why not give a default value. {{space}} should give the same result as {{space|1}} ManishEarthTalkStalk 12:09, 16 April 2010 (UTC)[reply]

Discussion

[edit]
 – Just a notice.

See Wikipedia:Village_pump_(proposals)#Should_the_underscore_be_used_as_mark-up_for_non-breaking_spaces.3F ManishEarthTalkStalk 12:10, 16 April 2010 (UTC)[reply]

Overhaul

[edit]

This template is hosed. See Template:Space/comparison for a thorough investigation of just how broken it is.

{{editprotected}} Please replace the template with the properly tested version at Template:Space/sandbox (as of this writing). The new code works cross-platform, cross-browser, at any font size and regardless of font and regardless of unicode support; it does not allow linebreaks, which defeat the purpose of the template; it actually works up to |1=30 the way it was supposed to; it will not play tricks on small-screened mobile devices to prevent them from collapsing whitespace that they cannot handle; it has a default value, as was requested a long time ago. Basically, every problem reported here, and others besides, are now fixed.

Demo:

Space me once
Space me   thrice
Space me               15 times, bay-bay.
<drum roll>

SMcCandlish Talk⇒ ʕ(Õلō Contribs. 02:23, 17 October 2011 (UTC)[reply]

Done. Please make sure that the template does what you expected it to do. Nyttend (talk) 12:30, 17 October 2011 (UTC)[reply]
I did notice I had to change {{space|12}} to margin-left:6em in this edit. Otherwise, everything looked like it was too far to the left. I'm sure there is a technical explanation! --Funandtrvl (talk) 15:31, 20 October 2011 (UTC)[reply]

Updated doc subpage to match overhaul

[edit]

On 13 March 2012, I changed the doc subpage, Template:Space/doc to match the current operation of the overhauled version, as inserting multiple non-breaking spaces "&nbsp;&nbsp;&nbsp;...". To remind users of the difference, I added new doc section "History" to note that formerly (for 6 years), the template had inserted em-spaces or a mix of &nbsp and regular spaces, etc. I also noted that the common interwiki Template:In5 can be used to insert wrappable spaces, as purposely designed to auto-reduce the spacing when used on narrow windows. -Wikid77 (talk) 16:43, 13 March 2012 (UTC)[reply]

Similar template

[edit]

Template {{spaces}} has a similar (or the same) purpose as this template, but contrary to this template (which uses an ugly method) is uses a better code. Could {{space}} better serve as a redirect to that template? --Götz (talk) 19:19, 29 May 2013 (UTC)[reply]

Request db-t3

[edit]

As stated above last month, this template is a duplicate of {{spaces}}. Thus, it meets speedy deletion criteria under "T3. Duplication and hardcoded instances." Please add {{db-t3|~~~~~|Spaces}}. A redirection from this template to {{spaces}} will work, as both templates use the same syntaxis. --Götz (talk) 16:44, 17 June 2013 (UTC)[reply]

Partly done: I agree with the redirection proposal, and I have implemented it. We can't delete the template, though, as it has 22,000 transclusions at the moment. Also, the template is not quite an identical copy, as it now has different behaviour if the first positional parameter is not a number. For example, previously the code {{space|foo}} would have produced &nbsp;, but now it will produce an error. These errors are tracked in the category Category:Errors reported by Module String, though, so I didn't think this too big a risk. If you could keep an eye on the category for any new errors, it would be appreciated. Best — Mr. Stradivarius ♪ talk ♪ 14:22, 26 June 2013 (UTC)[reply]
I will, thanks! --Götz (talk) 19:36, 29 June 2013 (UTC)[reply]

Protected edit request on 17 March 2018

[edit]

Leave a blank second line (a newline at that) and please add this on the third line:
{{Rcat shell|{{R from modification}}}}
stranger195 (talkcontribsguestbook) 05:16, 17 March 2018 (UTC)[reply]

 Done — Martin (MSGJ · talk) 20:48, 17 March 2018 (UTC)[reply]