NexusWiki:Discussions:Using templates for common tables

From NexusWiki
Revision as of 17:00, 21 August 2005 by PhantomSnake (talk | contribs)

Here's an idea I had... We could use templates to simplify the use of tables and ensure a consistent look. I'll use the Hunting areas table on the Buya as an example. Currently the table code looks like this:

{|
|-style="background:silver"
| Area || Location || Prerequisites
|-
| [[Buya rat cave | Rat cave]] || 0015 0077 || Level 3
|-
| [[Buya rabbit cave | Rabbit cave]] || 0111 0125 || Level 9
|-
| [[Buya fox cave | Fox cave]] || 0124 0143 || Level 20
|-
| [[Sute's cave]] || 0103 0022 || Level 28, [[Sute dye]]
|-
| [[Buya haunted house | Haunted house]] || 0009 0065 || Level 36
|}

We could replace the top portion (the first row) with a template. Then, the new code would be:

{{Hunting area table}}
| [[Buya rat cave | Rat cave]] || 0015 0077 || Level 3
|-
| [[Buya rabbit cave | Rabbit cave]] || 0111 0125 || Level 9
|-
| [[Buya fox cave | Fox cave]] || 0124 0143 || Level 20
|-
| [[Sute's cave]] || 0103 0022 || Level 28, [[Sute dye]]
|-
| [[Buya haunted house | Haunted house]] || 0009 0065 || Level 36
{{/Hunting area table}}

The {{/Hunting area table}} template is just for symmetry. (We could have a generic {{End table}} template, but that's less flexible. However, we could use {{End table}} inside {{/Hunting area table}}.)

I created an example of this setup here.

Opinions?

--PhantomSnake 19:53, 21 Aug 2005 (EDT)