Jump to content

Template:inflection-table-top

From Wiktionary, the free dictionary

This template is designed to make it easy to create inflection tables that:

  • appear correctly for readers using mobiles and tablets as well as computers
  • fit in with the consistent look and feel of Wiktionary
  • use contrasting text and background colours that meet accessibility guidelines in both light mode and dark mode
  • do not require in-depth knowledge of HTML or CSS syntax on the part of the creator

Usage

These templates are not intended to be used directly in entries. Instead, they can be transcluded from inflection table templates.

{{inflection-table-top}} takes the following parameters:

|title=
The title of the inflection table. Defaults to Inflection of PAGENAME if not specified. You can set this parameter to - if you don't want a title at all.
|palette=
Select a color palette from the following options:
grey, red, scarlet, orange, amber, yellow, lime, green, teal, cyan, blue, indigo, purple, magenta, rose, brown
All palettes are currently dark-on-light ("pastel" colours).
The default palette is grey.
|lang= (optional)
You can specify the language code of this inflection table. This is only used for applying a CSS class inflection-table-{{{lang}}} to the table, which may be referenced by scripts or personal stylesheets. It doesn't affect the look or content of the table at all.
|tall=yes (optional)
This should be specified on tables with more than about 8 lines of content. It makes the table collapsible and hidden by default.
|class= (optional)
Use this to apply a CSS class (or classes) to the <div> element that wraps the inflection table. This can be used to influence the table's appearance in a particular way.
The following classes are pre-defined in this template's CSS file:
  • sticky-left-column: On mobile phones and other narrow screens, this class "sticks" the leftmost column of the table in place when the user scrolls to the right, making it easier for the user to match each inflected form to its grammatical role. This should only be used on tables which have exactly one column of header cells down the left side.

In between the two templates, write wikitext table syntax to construct the inflection table (see examples below).

{{inflection-table-bottom}} takes one parameter:

|notes= (optional)
Contains notes to be shown at the foot of the table.

Examples

Basic example

Create a new template page and insert the following wikitext:

{{inflection-table-top|title=Inflection of {{m|en||{{PAGENAME}}}}|palette=blue}}
! 
! singular
! plural
|-
! nominative
| {{l-self|en|{{PAGENAME}}}}
| {{l-self|en|{{PAGENAME}}s}}
|-
! possessive 
| {{l-self|en|{{PAGENAME}}'s}}
| {{l-self|en|{{PAGENAME}}s'}}
{{inflection-table-bottom}}

Notice carefully how ! and | have been used at the beginning of each line to create headers and regular cells, respectively.

When you use your new template on the entry carrot, the following table would appear:

Inflection of carrot
singular plural
nominative carrot carrots
possessive carrot's carrots'

Table formatting

This example, for a made-up language, shows some of the table and cell formatting features, including:

  • the use of colspan and rowspan syntax
  • class="outer" to format a secondary outer layer of header cells
  • class="separator" to divide the table into sections and guide the reader's eye

Notice that, when using class="separator", you should specify rowspan="999" (for a column separator) or colspan="999" (for a row separator) to ensure the separator divides the entire table.

{{inflection-table-top|title=Declension of ''{{{1}}}k''|palette=rose}}
! class="outer" |
! colspan="3" class="outer" | singular
! rowspan="999" class="separator" |
! colspan="2" class="outer" | plural
|-
! 
! masculine
! feminine
! neuter
! masc./fem.
! neuter
|-
! absolutive
| {{l-self|und|{{{1}}}k}}
| {{l-self|und|{{{1}}}ki}}
| rowspan="2" | {{l-self|und|{{{1}}}ka}}
| {{l-self|und|{{{1}}}kezz}}
| rowspan="2" | {{l-self|und|{{{1}}}kizz}}
|-
! ergative
| {{l-self|und|{{{1}}}t}}
| {{l-self|und|{{{1}}}kit}}
| {{l-self|und|{{{1}}}kezzd}}
|-
! possessive
| {{l-self|und|{{{1}}}p}}
| {{l-self|und|{{{1}}}kip}}
| {{l-self|und|{{{1}}}kap}}
| {{l-self|und|{{{1}}}kezzup}}
| {{l-self|und|{{{1}}}kizzup}}
{{inflection-table-bottom}}
Declension of qoluk
singular plural
masculine feminine neuter masc./fem. neuter
absolutive qoluk qoluki qoluka qolukezz qolukizz
ergative qolut qolukit qolukezzd
possessive qolup qolukip qolukap qolukezzup qolukizzup

Tall example

An example of an inflection table that contains many forms:

{{inflection-table-top|title=Declension of {{m|en||{{PAGENAME}}}}|palette=orange|tall=yes}}
! 
! singular
! plural
|-
! nominative
| {{l|en|{{PAGENAME}}}}
| {{l|en|{{PAGENAME}}s}}
|-

...

{{inflection-table-bottom}}
Declension of inflection-table-top
singular plural
nominative carrot carrots
possessive carrot's carrots'

Style guide

  • At the time of creation of this template, the majority of inflection table templates on Wiktionary used lowercase grammatical labels ("singular", "present", "nominative").


[[Category:]]