Template:Responsive table header/doc

From Yugipedia
Jump to: navigation, search

{{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
0001 4007 Blue-Eyes White Dragon Monster Normal LIGHT Dragon 8 3000 2500 89631139
0002 4008 Mystical Elf Monster Normal LIGHT Spellcaster 4 800 2000 15025844
0003 4009 Hitotsu-Me Giant Monster Normal EARTH Beast-Warrior 4 1200 1000 76184692

See also[edit]