साँचा:Table cell templates/doc

मुक्त ज्ञानकोश विकिपीडिया से
< साँचा:Table cell templates
imported>Xqbot द्वारा परिवर्तित १८:५३, २२ अप्रैल २०२० का अवतरण (Bot: Replace deprecated <source> tag and "enclose" parameter [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html])
(अन्तर) ← पुराना अवतरण | वर्तमान अवतरण (अन्तर) | नया अवतरण → (अन्तर)
नेविगेशन पर जाएँ खोज पर जाएँ

{{

 साँचा:namespace detect

| type = notice | image = | imageright = | class = | style = margin-bottom:1.0em; | textstyle = | text = साँचा:strong for साँचा:terminate sentence
It contains usage information, categories and other content that is not part of the original साँचा page. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}

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 coloured background. They are commonly used in comparison tables.

For example, {{yes}} makes a cell with a green background. The text in the cell is taken from the first parameter; {{yes|Sure}} 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: {{table cell template}} text or {{table cell template}} | text. 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. colspan or rowspan, they need to be put before the template call and there must be no vertical bar | in between them:

साँचा:yes No rowspan=2 साँचा:n/a
Yes/No
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...

Templates in this series

Table cell templates
Class[१] Template Preview Preview, alternative
table-rh {{rh}} | Row header साँचा:rh | Row header
{{rh2}}[२] | Row header साँचा:rh2 | Row header
table-yes {{yes}}, {{yes|Alternative [[Plain text|text]]}} साँचा:yes साँचा:yes
table-no {{no}}, {{no|Alternative [[Plain text|text]]}} साँचा:no साँचा:no
{{coming soon}} साँचा:coming soon
table-siteactive {{Site active}} साँचा:site active
table-siteinactive {{Site inactive}} साँचा:site inactive
table-yes2 {{yes2}}[३] Text साँचा:yes2Text
{{won}}, {{won|5}} साँचा:won साँचा:won
{{good}}, {{good|A}} साँचा:good साँचा:good
table-no2 {{no2}}[३] Text साँचा:no2 Text
{{nom}}, {{nom|5}} साँचा:nom साँचा:nom
{{bad}}, {{bad|F}} साँचा:bad साँचा:bad
{{sho}} साँचा:sho
table-partial {{partial}} साँचा:partial
{{yes-No}} Yes/No
{{okay}}, {{okay|C}} साँचा:okay साँचा:okay
{{some}} साँचा:some
table-any {{any}} साँचा:any
table-na {{n/a}} साँचा:n/a
{{BLACK}} N/A
table-unknown {{dunno}} साँचा:dunno
{{Unknown}} Unknown
table-depends {{Depends}}, {{Depends|Alternative [[Plain text|text]]}} निर्भर है Alternative text
table-included {{Included}} सम्मिलित
table-dropped {{dropped}} साँचा:dropped
{{terminated}} साँचा:terminated
table-beta {{beta}} साँचा:beta
{{table-experimental}} साँचा:table-experimental
table-free {{free}}, {{free|Alternative [[Plain text|text]]}} साँचा:free साँचा:free
table-nonfree {{nonfree}}, {{nonfree|Alternative [[Plain text|text]]}} साँचा:nonfree साँचा:nonfree
table-proprietary {{proprietary}}, {{proprietary|Alternative [[Plain text|text]]}} साँचा:proprietary साँचा:proprietary
table-needs {{needs}}, {{needs|Alternative [[Plain text|text]]}} साँचा:needs साँचा:needs
no class {{incorrect}}, {{incorrect|Alternative [[Plain text|text]]}} साँचा:incorrect साँचा:incorrect
no class {{no result}}, {{no result|N.R.}} No result N.R.
no class {{pending}} आगामी
table-nightly {{nightly}}, {{nightly|Alternative [[Plain text|text]]}} साँचा:nightly साँचा:nightly
table-release-candidate {{release-candidate}}, {{release-candidate|Alternative [[Plain text|text]]}} साँचा:release-candidate साँचा:release-candidate
no class {{?}}[४] ?
no class {{unofficial}} Unofficial

Code

Common code to most if not all the templates in this series:

This template documentation is transcluded from Template:Table cell templates [edit]

These templates are designed to be used in a table to make a cell with text in that cell, with an appropriately coloured background. They are commonly used in comparison tables.

For example, {{Yes}} makes a cell with a green background; the text in the cell is taken from the template parameter and defaults to "Yes".

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 Dropped, change that to {{{1|Dropped}}}.

Templates in this series

CSS class[१] Templates Preview 1 Preview 2 Preview 3
table-rh साँचा:tl[२] | Row header साँचा:rh | Row header
table-yes साँचा:tl, साँचा:tlp हाँ Alternate text
table-नहीं साँचा:tl नहीं
table-yes2 साँचा:tl[३] Text साँचा:yes2 Text
table-no2 साँचा:tl[३] Text साँचा:no2 Text
table-partial साँचा:tl, साँचा:tl, साँचा:tl आंशिक Yes/No साँचा:some
table-any साँचा:tl साँचा:any
table-na साँचा:tl साँचा:n/a
table-unknown साँचा:tl, साँचा:tl साँचा:dunno साँचा:unk
table-depends साँचा:tl साँचा:depends
table-included साँचा:tl साँचा:included
table-dropped साँचा:tl, साँचा:tl साँचा:dropped साँचा:terminated
table-beta साँचा:tl साँचा:beta
table-free साँचा:tl साँचा:free
table-nonfree साँचा:tl[३] [[US$]]3.14 साँचा:nonfree US$3.14
unstyled साँचा:tl साँचा:incorrect
unstyled साँचा:tl[४] ?

Notes

  1. The HTML class of table cell templates may be referenced in a user stylesheet to change appearance. सन्दर्भ त्रुटि: <ref> अमान्य टैग है; "table-cell-templates-table-css" नाम कई बार विभिन्न सामग्रियों में परिभाषित हो चुका है
  2. Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.
  3. Does not take a parameter; the content should be placed after the template call.
  4. Does not take a parameter; not really a table cell template at all, but here for completeness


Code specific to this template:

This template documentation is transcluded from Template:Table cell templates [edit]

These templates are designed to be used in a table to make a cell with text in that cell, with an appropriately coloured background. They are commonly used in comparison tables.

For example, {{Yes}} makes a cell with a green background; the text in the cell is taken from the template parameter and defaults to "Yes".

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 Dropped, change that to {{{1|Dropped}}}.

Templates in this series

CSS class[१] Templates Preview 1 Preview 2 Preview 3
table-rh साँचा:tl[२] | Row header साँचा:rh | Row header
table-yes साँचा:tl, साँचा:tlp हाँ Alternate text
table-नहीं साँचा:tl नहीं
table-yes2 साँचा:tl[३] Text साँचा:yes2 Text
table-no2 साँचा:tl[३] Text साँचा:no2 Text
table-partial साँचा:tl, साँचा:tl, साँचा:tl आंशिक Yes/No साँचा:some
table-any साँचा:tl साँचा:any
table-na साँचा:tl साँचा:n/a
table-unknown साँचा:tl, साँचा:tl साँचा:dunno साँचा:unk
table-depends साँचा:tl साँचा:depends
table-included साँचा:tl साँचा:included
table-dropped साँचा:tl, साँचा:tl साँचा:dropped साँचा:terminated
table-beta साँचा:tl साँचा:beta
table-free साँचा:tl साँचा:free
table-nonfree साँचा:tl[३] [[US$]]3.14 साँचा:nonfree US$3.14
unstyled साँचा:tl साँचा:incorrect
unstyled साँचा:tl[४] ?

Notes

  1. The CSS class of table cell templates may be referenced in a user stylesheet to change appearance.
  2. Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.
  3. Does not take a parameter; the content should be placed after the template call.
  4. Does not take a parameter; not really a table cell template at all, but here for completeness


To make a new table cell template you can use:

{{subst:Table cell templates| text = default text | bg = background color | class = a class name without prefix | align = standard horizontal alignment}}

You should leave out the align parameter and often the class parameter is unnecessary, too.

Add the new template to the table in the 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 Dropped, change that to {{{1|Dropped}}}.

See also

Notes