ފަންވަތް:Table cell templates/doc: Difference between revisions

Content deleted Content added
Created page with "<noinclude>{{Documentation subpage}}</noinclude> {{#ifeq:{{FULLPAGENAME}}|Template:BLACK|{{For|the text color template|Template:Black}}}} The templates in this series are desi..."
 
m Bot: Replace deprecated <source> tag and "enclose" parameter; cosmetic changes
 
ފޮޅުވަތް 1:
<noinclude>{{Documentation subpage}}</noinclude>
{{#ifeq:{{FULLPAGENAME}}|Template:BLACK|{{For|the text color template|Template:Black}}}}
The templates in this series are designed to be used in a [[Helpއެހީ:Table|table]] to make a cell with text in that cell, with an appropriately colored background. They are commonly used in [[:Category:Comparisons|comparison tables]].
 
For example, {{Tlc|yes}} makes a cell with a green background. The text in the cell is taken from the [[Helpއެހީ:Template#Parameters|first parameter]]; <code><nowiki>{{</nowiki>yes|Sure}}</code> would output "Sure" otherwise it defaults to "Yes". 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: <code><nowiki>{{</nowiki>''table cell template''}} ''text''</code> or <code><nowiki>{{</nowiki>''table cell template''}} | ''text''</code>. This information, the colors and default texts are found in the table below.
 
If you want to use other attributes for the table cells, ''e.g.'' <code>colspan</code> or <code>rowspan</code>, they need to be put before the template call and there must be no vertical bar <code>|</code> in between them:
ފޮޅުވަތް 146:
 
To make a new table cell template you can use:
<syntaxhighlight lang=text enclose="divtext">{{subst:Table cell templates|text= default text |bg= background color |class= a class name without prefix |align= standard horizontal alignment}}</syntaxhighlight>
 
You should leave out the <code>align</code> parameter and often the <code>class</code> parameter is unnecessary, too.
 
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.
 
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 <code>Dropped</code>, change that to <code><nowiki>{{{1|Dropped}}}</nowiki></code>.
ފޮޅުވަތް 197:
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Categoryޤިސްމު:Unified table cell templates]]
</includeonly>