<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Vorlage%3ATable_cell_templates%2Fdoc</id>
	<title>Vorlage:Table cell templates/doc - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Vorlage%3ATable_cell_templates%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Vorlage:Table_cell_templates/doc&amp;action=history"/>
	<updated>2026-04-05T19:06:34Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Verzauberte Welten e.V.</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.verzauberte-welten.de/index.php?title=Vorlage:Table_cell_templates/doc&amp;diff=316&amp;oldid=prev</id>
		<title>mw&gt;Oetterer: /* Code */</title>
		<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Vorlage:Table_cell_templates/doc&amp;diff=316&amp;oldid=prev"/>
		<updated>2015-02-04T07:15:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Code&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Documentation subpage}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
The templates in this series are designed to be used in a table to make a cell with text in that cell, with an appropriately colored background.  They are commonly used in comparison tables.&lt;br /&gt;
&lt;br /&gt;
For example, {{Tlc|yes}} makes a cell with a green background. The text in the cell is taken from the first parameter; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;yes|Sure}}&amp;lt;/code&amp;gt; would output &amp;quot;Sure&amp;quot; otherwise it defaults to &amp;quot;Yes&amp;quot;. Most templates allow authors to override the default text in this way, some require text put after the template call and some also need a vertical bar in between: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;''table cell template''}} ''text''&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;''table cell template''}} | ''text''&amp;lt;/code&amp;gt;. This information, the colors and default texts are found in the table below.&lt;br /&gt;
&lt;br /&gt;
If you want to use other attributes for the table cells, ''e.g.'' &amp;lt;code&amp;gt;colspan&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;rowspan&amp;lt;/code&amp;gt;, they need to be put before the template call and there must be no vertical bar &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; in between them:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable align=right&lt;br /&gt;
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
|colspan=2 {{Yes-No}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
|colspan=2 {{Yes-No}}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table cell templates&lt;br /&gt;
! Class &amp;lt;ref name=&amp;quot;table-cell-templates-table-css&amp;quot;&amp;gt;The HTML class of table cell templates may be referenced in a [[metawikimedia:help:User style|user stylesheet]] to change appearance.&amp;lt;/ref&amp;gt; !! Default syntax !! Preview (default) !! Customized syntax !! Preview (customized)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;table-rh&amp;lt;/code&amp;gt; || {{Tl|rh}} {{!}} Row header&amp;lt;ref name=&amp;quot;table-cell-templates-table-after+pipe&amp;quot;&amp;gt;Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.&amp;lt;/ref&amp;gt; || {{rh}} | Row header || {{tlp|rh|2=align=right}} {{!}} Row header ||  {{rh|align=right}} | Row header&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| &amp;lt;code&amp;gt;table-yes&amp;lt;/code&amp;gt; || {{Tl|yes}} || {{yes}} || {{Tlp|yes|&amp;lt;nowiki&amp;gt;Customized text&amp;lt;/nowiki&amp;gt;}} ||{{yes|Customized text}}&lt;br /&gt;
|-&lt;br /&gt;
| {{tl|ya}} || {{Ya}} || {{tlp|ya|Customized alt text|link{{=}}WP:ALT}} || {{Ya|Customized alt text|link=WP:ALT}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| &amp;lt;code&amp;gt;table-no&amp;lt;/code&amp;gt; || {{Tl|no}} || {{no}} || {{Tlp|no|&amp;lt;nowiki&amp;gt;Customized text&amp;lt;/nowiki&amp;gt;}} || {{no|Customized text}}&lt;br /&gt;
|-&lt;br /&gt;
| {{tl|na}} || {{Na}} || {{tlp|na|Customized alt text|link{{=}}WP:ALT}} || {{Na|Customized alt text|link=WP:ALT}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;table-partial&amp;lt;/code&amp;gt; || {{Tl|yes-No}} || {{Yes-No}} ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;table-na&amp;lt;/code&amp;gt; || {{Tl|n/a}} || {{n/a}} ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Common code to most if not all the templates in this series:&lt;br /&gt;
:&amp;lt;code&amp;gt;{{Table cell templates|class=''automatic''|text=''text''|bg=#''abcdef''}}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Code specific to this template:&lt;br /&gt;
:&amp;lt;code&amp;gt;{{ {{#ifeq:{{BASEPAGENAME}}|N|N/a|{{BASEPAGENAME}}}} }}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make a new table cell template you can use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=text enclose=&amp;quot;div&amp;quot;&amp;gt;{{subst:Table cell templates|text= default text |bg= background color |class= a class name without prefix |align= standard horizontal alignment}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should leave out the &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; parameter and often the &amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt; parameter is unnecessary, too.&lt;br /&gt;
&lt;br /&gt;
Add the new template to the table in the [[Template:Table cell templates/doc|common documentation]] afterwards. Please consider reusing one of the other templates and please choose the color sensibly.&lt;br /&gt;
&lt;br /&gt;
If you find a table cell template that does not take a parameter and you want to be able to change the text in the cell, ''do not'' duplicate the template! Instead, edit the template and change the text to a default parameter substitution.  For example, if a template's text is &amp;lt;code&amp;gt;Dropped&amp;lt;/code&amp;gt;, change that to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{{1|Dropped}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- ADD CATEGORIES BELOW THIS LINE --&amp;gt;&lt;br /&gt;
[[Category:Table, column and cell templates]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>mw&gt;Oetterer</name></author>
	</entry>
</feed>