Help:Tables

This article details the use of tables on Nookipedia. Item tables should be formatted using Template:TableTop and Template:TableFooter. All other tables should use the  class to automatically generate formatting for the appearance of the table.

The code for certain tables is formatted and stored on a template page, and then this code is called using the proper template call. These templates can be found at Category:Table templates. Tables should only be stored as templates if they are intended to be adapted or transcluded on multiple pages.

Creating tables
All tables begin with  and end with. For example:

{| class="styled color-nookipedia" style="width:100%; text-align:center;" ! style="width:50%" | Wiki source ! style="width:50%" | Rendered result
 * style="text-align:left;"|
 * style="text-align:left;"|
 * }

Each new line starts with the a pipe character  which creates a new cell. A line with with a pipe-dash  creates a new row. Using  instead of   to start a line creates bold, centered text. Note that these symbols will only generate a table if they are placed at the beginning of a line.

CSS can be used style tables, rows, and cells. An example can be seen in the above table where  is added after the opening table tag to style the entire table. is added after a new row tag to style that specific row. A method to style an existing cell can be seen in the bottom right cell where the total of 15.00 is bolded by using the code.

Item tables should be formatted using Template:TableTop and Template:TableFooter. All other tables should use the  class to automatically generate formatting for the appearance of the table.

Styling
Different colours can be automatically applied to  tables by appending one of the below classes. The chosen color should ideally match the infobox and navbox color used on the page. It is acceptable to use different colors on pages with lots of tables, or different categories where having distinguishing colors may serve a practical purpose (e.g. Nook Miles or Shoes).

Colors
•

•

•

•

•

•

•

•

•

•

•

•

•

Themes
•

•

•

•

•

•

•

•

•

•

•

•

•

Categories
•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

•

Formatting
Only minimal custom formatting should be used on tables, in order to maintain a consistent appearance across the wiki. It is not necessary to format the appearance of a table to have rounded borders or white-colored cells when the  class is used.

and  attributes are deprecated should not be used. Instead these should be formatted like so:

Individual cells can be given their own distinct background color, but this should generally shouldn't be done without purpose (see example).

Sorting data
A sort functionality can be added to a table using the  class. Some consideration should be made before making a table sortable, however. Also, individual columns can have sorting disabled using the  class for that column's header.


 * Data should be in a clear, singular format. Cells with multiple values are not practical for clear sorting of data and should be avoided.
 * Consider splitting data into individual cells and expanding other cells using  and   to group it.
 * Cells with lots of text, such as descriptions, and cells with images should never be made sortable.
 * Tables with only one valid column for sorting should not be made sortable, as there is only a single way to arrange data therefore making the sorting functionality practically useless.

Resources

 * Editing Wikitext/Tables - Extensive guide to generating tables using wikitext.
 * Help:Tables - Abbreviated guide to table creation.