Difference between revisions of "Template:Responsive table header/doc"

From Yugipedia
Jump to: navigation, search
(Different mobile and desktop text)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
{{t|Responsive table header}} is used to create the heading of a table in such a way that the table will restyle itself to fit better on the smaller screens of mobile devices.
+
{{t|Responsive table header}} and {{t|Responsive table footer}} are used to create the heading of a table in such a way that the table will restyle itself to fit better on the smaller screens of mobile devices.
  
 
=== Usage ===
 
=== Usage ===
Line 22: Line 22:
 
| [[LIGHT]]
 
| [[LIGHT]]
 
| [[Dragon]]
 
| [[Dragon]]
 +
| 8
 
| 3000
 
| 3000
 
| 2500
 
| 2500
Line 28: Line 29:
 
| [[DARK]]
 
| [[DARK]]
 
| [[Spellcaster]]
 
| [[Spellcaster]]
 +
| 7
 
| 2500
 
| 2500
 
| 2100
 
| 2100
Line 76: Line 78:
 
| [[LIGHT]]
 
| [[LIGHT]]
 
| [[Dragon]]
 
| [[Dragon]]
 +
| 8
 
| 3000
 
| 3000
 
| 2500
 
| 2500
Line 82: Line 85:
 
| [[DARK]]
 
| [[DARK]]
 
| [[Spellcaster]]
 
| [[Spellcaster]]
 +
| 7
 
| 2500
 
| 2500
 
| 2100
 
| 2100

Latest revision as of 17:56, 1 January 2020

{{Responsive table header}} and {{Responsive table footer}} are used to create the heading of a table in such a way that the table will restyle itself to fit better on the smaller screens of mobile devices.

Usage[edit]

Basic[edit]

The table has a columns parameter. This is used to define the text in the heading of each column. Put the text for each column on a new line.

Links, bold and italics will automatically be stripped from the column text when forming labels on mobile. These are not supported in the mobile set up.

{{Responsive table header
| columns = 
Card
[[Attribute]]
[[Type]]
[[Level]]
[[ATK]]
[[DEF]]
}}
|-
| [[Blue-Eyes White Dragon]]
| [[LIGHT]]
| [[Dragon]]
| 8
| 3000
| 2500
|-
| [[Dark Magician]]
| [[DARK]]
| [[Spellcaster]]
| 7
| 2500
| 2100
{{Responsive table footer}}
Card Attribute Type Level ATK DEF
Blue-Eyes White Dragon LIGHT Dragon 8 3000 2500
Dark Magician DARK Spellcaster 7 2500 2100

Different mobile and desktop text[edit]

If a label is to have different text on mobile and desktop, enter the mobile text, followed by a semicolon (;), followed by the desktop text.

{{Responsive table header
| columns = 
Number; {{explain|#|Number}}
Card
[[Attribute]]
[[Type]]
[[Level]]
[[ATK]]
[[DEF]]
}}
|-
| [[Blue-Eyes White Dragon]]
| [[LIGHT]]
| [[Dragon]]
| 8
| 3000
| 2500
|-
| [[Dark Magician]]
| [[DARK]]
| [[Spellcaster]]
| 7
| 2500
| 2100
{{Responsive table footer}}
# Card Attribute Type Level ATK DEF
4007 Blue-Eyes White Dragon LIGHT Dragon 8 3000 2500
4041 Dark Magician DARK Spellcaster 7 2500 2100

Semantic query[edit]

Often, the table rows will be the result of an SMW query. In that scenario, the query should use |format=plain|template=Table row

{{Responsive table header
| columns =
Number; {{explain|#|Number}}
Internal number; {{explain|I#|Internal number}}
Card
[[Card type]]
Monster type
[[Attribute]]
Type
[[Level]]
[[ATK]]
[[DEF]]
[[Password]]
}}<!--
-->{{ #ask: [[Release::Yu-Gi-Oh! 7 Trials to Glory: World Championship Tournament 2005]]
|?Card number
|?Internal number
|?English name (linked)
|?Card type (short)
|?Monster type (short)
|?Attribute
|?Type
|?Level
|?ATK string
|?DEF string
|?Password
| limit       = 3
| mainlabel   = -
| searchlabel = 
| sort        = Card number
| format      = plain
| template    = table row
}}
{{Responsive table footer}}
# I# Card Card type Monster type Attribute Type Level ATK DEF Password

See also[edit]