Open main menu

Yugipedia β

Template:Responsive table header/doc

< Template:Responsive table header

{{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.

UsageEdit

BasicEdit

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 textEdit

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 queryEdit

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 alsoEdit