Module:HeroTableBuilder/doc

HeroTableBuilder is a Lua-only builder interface for generating Hero tables that can be sorted and filtered using Template:DropdownSelects and its variants.

Constructor

 * new 
 * Returns a new builder object. Call methods on the builder object to generate the actual HTML table.

Methods

 * build 
 * Returns the  root of the generated HTML table. The table is added to the   class automatically; all other classes and styles have to be added manually.


 * column (title, fn)
 * Adds a generic table column with the given column title. Returns the &lt;th&gt; node of the column header.  is used in the addHero function below to produce cell values.


 * heroIcon (size)
 * Adds a portrait icon column, with the given size (or  if omitted). Returns the &lt;th&gt; node of the column header.


 * heroLink 
 * Adds a page link column. Returns the &lt;th&gt; node of the column header.


 * heroEntry (size)
 * Adds an entry icon column, with the given size (or  if omitted). Returns the &lt;th&gt; node of the column header.


 * moveType (size)
 * Adds a move type icon column, with the given size (or  if omitted). Returns the &lt;th&gt; node of the column header.


 * weaponType (size)
 * Adds a weapon type icon column, with the given size (or  if omitted) Returns the &lt;th&gt; node of the column header.


 * addHero (page, name, mov, wep, entry)
 * Adds a Hero with the given page, name, move type, weapon type, and comma-separated entry list to the table. Also calls  on each generic table cell, where   is the &lt;td&gt; node of the table cell.

Example
The following code is also available on Module:HeroTableBuilder/example.