Template:Expandable table

From Wizards and Warlords
Jump to navigation Jump to search

About this template

[edit]

Creates a table that initially loads collapsed and can be expanded by selecting its caption. On phone and tablet, the caption also works as the accessible JavaScript-controlled toggle.

The template keeps the existing wizlords-example-table class required by the site JavaScript. Use HTML table rows inside content so wiki-table pipe characters do not interfere with template parameters.

Parameters

[edit]
  • caption - title displayed above the table and used as the expandable control.
  • class - optional existing modifier classes, such as wizlords-example-table-full-heal or wizlords-reputation-table.
  • content - table header and data rows written with tr, th, and td elements.

Basic example

[edit]
{{Expandable table
|caption=Example: Arcane Bolt
|content=
<tr>
<th>Spell Level</th>
<th>Spell Point Cost</th>
</tr>
<tr>
<td>Level 1</td>
<td>1 Spell Point</td>
</tr>
}}

Keep the caption and generated table classes unchanged because CSS, keyboard behavior, and JavaScript depend on them.