Guild Wars 2 wiki:Table formatting

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
Shortcut:
GW2W:TABLE

General syntax[править]

Note: if you are not familiar with wiki table syntax, please, read Wikipedia's tutorial.

To make a table, just add {{STDT}} to the table formatting. This way the following code

{| {{STDT}}
! colspan="3" | [[Bronze Ingot]] recipe
|-
| align="right" | 10
| align="center" | [[File:Copper Ore.png|20px]]
| align="left" | [[Copper Ore]]
|-
| align="right" | 1
| align="center" | [[File:Lump of Tin.png|20px]]
| align="left" | [[Lump of Tin]]
|}

will generate a table like this:

Bronze Ingot recipe
10 Copper Ore.png Copper Ore
1 Lump of Tin.png Lump of Tin

Multiple headings[править]

The first row is always a heading row with its unique style. If you need another row with this design, simply add class="heading" to row formatting. For example, the following code

{| {{STDT}}
! DE
|-
| Abaddon's Mouth
|-
| Dasha
|-
| Drakkar Lake
|- class="heading"
! FR
|-
| Arborstone
|-
| Augury Rock
|-
| Echovald Forest
|- class="heading"
! General
|-
| Aurora Glade
|-
| Bjora Marches
|-
| Blacktide
|}

will result in a table like this:

DE
Abaddon's Mouth
Dasha
Drakkar Lake
FR
Arborstone
Augury Rock
Echovald Forest
General
Aurora Glade
Bjora Marches
Blacktide

Table positioning[править]

Adding STDT template makes table position differently. They become in-line elements, which allows placing several small tables next to each other like this:

Bronze Ingot recipe
10 Copper Ore.png Copper Ore
1 Lump of Tin.png Lump of Tin
Steel Ingot recipe
2 Iron Ore.png Iron Ore
1 Lump of Coal.png Lump of Coal
Copper Ingot recipe
10 Copper Ore.png Copper Ore
Iron Ingot recipe
2 Iron Ore.png Iron Ore

Table width[править]

Sometimes tables should have defined widths. In this case, you can add width="X" to table formatting for small tables. For bigger ones, use style="width:100%;max-width:Xpx" instead, so that tables scale down on smaller resolutions. Note that defining a max-width will also require you to define a width of each cell in the 1st row (you can define widths using either percent, width=number%; or pixels, width=number; it will still scale down), or a table will not scale properly if it doesn't have enough content, like in the example below:

{| {{STDT}} style="width:100%;max-width:1000px;"
! A
! B
|-
| Lorem ipsum
| Dolor sit amet
|}
{| {{STDT}} style="width:100%;max-width:1000px;"
! width=400 | A
! width=600 | B
|-
| Lorem ipsum
| Dolor sit amet
|}

results in:

A B
Lorem ipsum Dolor sit amet
A B
Lorem ipsum Dolor sit amet

If 1st row has colspanned cells, it is better to define their width too, and then define width of the columns they are spanning in the next row, like this:

{| {{STDT}} style="width:100%;max-width:1000px;"
! colspan="2" width=1000 | A
|-
| width=400 | Lorem ipsum
| width=600 | Dolor sit amet
|}
A
Lorem ipsum Dolor sit amet

Table colors[править]

Tables may have different color depending on context. This can be done by adding an unnamed parameter to STDT template, like this:

{| {{STDT|recipe}}
! colspan="3" | [[Bronze Ingot]] recipe
|-
| align="right" | 10
| align="center" | [[File:Copper Ore.png|20px]]
| align="left" | [[Copper Ore]]
|-
| align="right" | 1
| align="center" | [[File:Lump of Tin.png|20px]]
| align="left" | [[Lump of Tin]]
|}
Bronze Ingot recipe
10 Copper Ore.png Copper Ore
1 Lump of Tin.png Lump of Tin

List of STDT parameters[править]

The following parameters can be added to STDT to modify table's colors:

Professions
guardian
warrior
engineer
ranger
thief
elementalist
mesmer
necromancer profession colors
Races
asura
charr
human
norn
sylvari racial colors
Common to professions and/or races
any Things available to any profession/race (for example downed skill Bandage, of environmental weapon skills like asura turret Chain Lightning)
Items
equip Equipment: weapons, armor, runes, sigils, etc.
crafting All crafting-related themes: disciplines, materials and components
recipe Crafting recipes
hom Hall of Monuments items
item Other items: junk, food, consumables, etc.
Game mechanics
npc NPC-related tables (e.g. list of scouts in Kryta)
pve PvE tables: dynamic events, renown hearts, personal storyline, dungeons, etc.
mech1 Major game mechanics: attributes, achievements, PvP
mech2 Other game mechanics: skills, traits, effects
lore Lore-related content: the Elder Dragons, religions, calendars etc.
location Locations of different levels: continents, countries, areas
promo Promotional game-related materials, like books, soundtrack etc.
boon Boons: aegis, swiftness, might, etc.
condition Conditions: burning, crippled, immobilized, etc.

When table uses several colors (e.g. list of shout skills) define colors within each row by adding class="XXX" to it, like this:

{| class="skills table"
! width=100 | Profession
! width=200 | Shout
! width=700 | Description
|- class="guardian"
! rowspan="3" | {{g}} [[Guardian]]
| {{skill icon|"Hold the Line!"}}
| {{skill description|"Hold the Line!"}}
|- class="guardian"
| {{skill icon|"Retreat!"}}
| {{skill description|"Retreat!"}}
|- class="guardian line"
| {{skill icon|"Stand Your Ground!"}}
| {{skill description|"Stand Your Ground!"}}
|- class="warrior"
! rowspan="4" | {{w}} [[Warrior]]
| {{skill icon|"Fear Me!"}}
| {{skill description|"Fear Me!"}}
|- class="warrior"
| {{skill icon|"For Great Justice!"}}
| {{skill description|"For Great Justice!"}}
|- class="warrior"
| {{skill icon|"I Will Avenge You!"}}
| {{skill description|"I Will Avenge You!"}}
|- class="warrior"
| {{skill icon|"Shake It Off!"}}
| {{skill description|"Shake It Off!"}}
|}

Other table classes[править]

There is also a special skills parameter used in the table above, which define table width for skills tables; and a sortable parameter, which will make table sortable:

{| {{STDT|sortable mesmer skills}}
! width=200 | [[Skill]]
! width=100 | Recharge
! width=700 | Description
|- 
! style="text-align:left" | {{skill icon|Mind Wrack}}
| {{recharge|15}}
| Destroy all your clones and phantasms, damaging nearby foes.
|- 
! style="text-align:left" | {{skill icon|Cry of Frustration}}
| {{recharge|30}}
| Destroy all your clones and phantasms, confusing nearby foes.
|- 
! style="text-align:left" | {{skill icon|Diversion}}
| {{recharge|45}}
| Destroy all your clones and phantasms, dazing their target.
|- 
! style="text-align:left" | {{skill icon|Distortion}}
| {{recharge|60}}
| Destroy all your clones and phantasms, gaining distortion for each one shattered.
|}
Skill Recharge Description
Mind Wrack.png
 Mind Wrack
15 Время перезарядки Destroy all your clones and phantasms, damaging nearby foes.
Cry of Frustration.png
 Cry of Frustration
30 Время перезарядки Destroy all your clones and phantasms, confusing nearby foes.
Diversion.png
 Diversion
45 Время перезарядки Destroy all your clones and phantasms, dazing their target.
Distortion.png
 Distortion
60 Время перезарядки Destroy all your clones and phantasms, gaining distortion for each one shattered.

By default, text in tables is aligned to the left horizontally, and to the middle vertically. Sometimes, it should be aligned differently. You can use the following classes to do that (note that it will not change heading alignment):

align-left, align-center, align-right
Used for horizontal alignment
align-top, align-middle, align-bottom
Used for vertical alignment
any pair of alignments used above (align-center-middle, align-top-right, etc.)
Used for both types of alignment

Example:

{| {{STDT|sortable item align-right}}
|-
! width=120 | Name
! width=50  | Condition Damage
! width=50  | Critical Damage
! width=50  | Healing Power
! width=50  | Power
! width=50  | Precision
! width=50  | Toughness
! width=50  | Vitality
|-
! style="text-align:left;" | [[Cleric's Jewel]]
|      ||      || +125 ||  +75 ||      ||  +75 || 
|-
! style="text-align:left;" | [[Berserker's Jewel]]
|      ||  +5% ||      || +125 ||  +75 ||      ||  +45
|-
! style="text-align:left;" | [[Knight's Jewel]]
|      ||      ||      ||  +75 ||  +75 ||      || +125
|-
! style="text-align:left;" | [[Rabid's Jewel]]
| +125 ||      ||      ||      ||  +75 ||  +75 || 
|}
Name Condition Damage Critical Damage Healing Power Power Precision Toughness Vitality
Cleric's Jewel +125 +75 +75
Berserker's Jewel +5% +125 +75 +45
Knight's Jewel +75 +75 +125
Rabid's Jewel +125 +75 +75

Cell and row borders[править]

To add borders to cells or rows you may use the following classes:

line, line-bottom
adds a line under the row/cell it is applied to
line-top
adds a line above the row/cell it is applied to
line-left, line-right
adds a line before/after the cell it is applied to (these classes aren't used with rows)

Colspanned and rowspanned cells automatically show all of their borders.

Always add line when a group of connected table rows ends, especially when several table rows have a common rowspanned cell at the beginning, like in the following example:

{| class="skills table"
! width=100 | Profession
! width=200 | Skill
! width=700 | Description
|- class="guardian"
! rowspan="3"  | {{g}} [[Guardian]]
| {{skill icon|Wrath}}
| {{skill description|Wrath}}
|- class="guardian"
| {{skill icon|Wave of Light}}
| {{skill description|Wave of Light}}
|- class="guardian line"
| {{skill icon|Symbol of Judgment}}
| {{skill description|Symbol of Judgment}}
|- class="warrior"
! rowspan="3" | {{w}} [[Warrior]]
| {{skill icon|Throw Rock}}
| {{skill description|Throw Rock}}
|- class="warrior"
| {{skill icon|Hammer Toss}}
| {{skill description|Hammer Toss}}
|- class="warrior line"
| {{skill icon|Vengeance}}
| {{skill description|Vengeance}}
|- class="engineer"
! rowspan="3" | {{en}} [[Engineer]]
| {{skill icon|Throw Junk}}
| {{skill description|Throw Junk}}
|- class="engineer"
| {{skill icon|Grappling Line}}
| {{skill description|Grappling Line}}
|- class="engineer line"
| {{skill icon|Booby Trap}}
| {{skill description|Booby Trap}}
|- class="any"
! rowspan="1" | {{any}} Common
| {{skill icon|Bandage}}
| {{skill description|Bandage}}
|}
Profession Skill Description
Guardian tango icon 20px.png Guardian
Wrath.png
 Wrath
Сфокусировать луч гневного света на вашем противнике. Поражает противников через которых проходит.
Wave of Light.png
 Wave of Light
Оттолкнуть назад противников поблизости.
Symbol of Judgment.png
 Symbol of Judgment
Начертать на земле символ, который исцеляет союзников и наносит урон противникам.
Warrior tango icon 20px.png Warrior
Throw Rock.png
 Throw Rock
Бросить камень в вашу цель.
Hammer Toss.png
 Hammer Toss
Бросить молот, который сбивает с ног противников.
Vengeance (skill).png
 Vengeance
Ожить и нормально сражаться некоторое время. У вас есть шанс ожить окончательно, если вы убьете противника. Когда отмщение заканчивается, вы будете побеждены.
Engineer tango icon 20px.png Engineer
Throw Junk.png
 Throw Junk
Бросить пригоршню мусора и вызвать случайное состояние у вашего противника.
Grappling Line.png
 Grappling Line
Бросить канат с крюком и подтянуть противника к себе.
Booby Trap.png
 Booby Trap
Установить взрывающуюся мину-ловушку, которая отбрасывает противников поблизости мощным взрывом.
Any tango icon 20px.png Common
Bandage.png
 Bandage
Позвать на помощь своих союзников. Восстанавливает здоровье, пока вы используете это умение.

See also[править]