Jump to content

英文维基 | 中文维基 | 日文维基 | 草榴社区

User:Permstrump/Tutorials

From Wikipedia, the free encyclopedia

List and table templates

[edit]

H:TABLE - H:LIST - H:COL

Category:List formatting and function templates

Glossary templates

[edit]

Template:Defn/doc

Glossary template

Example:

{{term|1=aspirin}}
{{defn|1=A mild analgesic of the non-steroidal anti-inflammatory drug (NSAID) family...}}
{{term|1=heroin}}
{{term|1=diacetylmorphine |multi=y}}
{{term|1=diamorpine |multi=y}}
{{defn|1=A synthetic narcotic drug of the opiate family...}}
{{term|1=ranitidine}}
{{defn|1=An antacid of the proton pump inhibitor family...}}

Result

Result: vs. no |multi=y
aspirin
A mild analgesic of the non-steroidal anti-inflammatory drug (NSAID) family...
heroin
diacetylmorphine
diamorpine
A synthetic narcotic drug of the opiate family...
ranitidine
An antacid of the proton pump inhibitor family...
aspirin
A mild analgesic of the non-steroidal anti-inflammatory drug (NSAID) family...
heroin
diacetylmorphine
diamorpine
A synthetic narcotic drug of the opiate family...
ranitidine
An antacid of the proton pump inhibitor family...
Term definition

Basic usage:

{{glossary}}

{{term|1=term}}
{{defn|1=Definition.}}

{{glossary end}}

Linking to the term:

{{term}} automatically creates anchors from the original term (|term= or |1=) or |id= value, as entered, and an all-lower-case version. About 90% of the links to glossary entries are going to be mid-sentence, and will expect to start with a lower-case letter, except for proper names. If your glossary has a case where one entry and another share the same name except for case, the second one must be given a unique |id=:

 {{term|term=Foo}}
{{term|term=foo|id=foo (2)}}

Lists

[edit]

Template:Pagelist

Template for listing wikilinks to multiple pages

This template is mostly useful from within other templates that accept a variable number of page names as arguments. For example, the page arguments {{{1}}}{{{10}}} can be passed to this template using {{pagelist|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|{{{10|}}}}}. Any parameters not specified to the original template will be passed as empty parameters and not listed by the pagelist template.

Examples:

Type this To get this
{{Pagelist|X1|X2|X3|X4|X5}} X1, X2, X3, X4 and X5
{{Pagelist|nspace=Template|X1|X2|X3|X4|X5}} X1, X2, X3, X4 and X5
{{Pagelist|nspace= |delim=''|X1|X2|X3|X4|X5}} X1, X2, X3, X4 and X5

{{flatlist}}

This template can be used with or without {{endflatlist}}. For navigation boxes using {{navbox}}, one can set |listclass=hlist, and achieve the same styling without using this template. For image captions, list (i.e. asterisk) markup does not work, so consider using {{hlist}} instead.

Basic

Syntax:
{{flatlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}
Examples:

Numbered lists

Syntax:
{{flatlist|
# [[first]]
# [[second]]
# [[third]]
# [[fourth]]
# [[fifth]]
# [[sixth]]
}}
Examples:

Template:Hlist

Horizontal lists with bullets
Markup Renders as
{{hlist|entry1|entry2|entry3|entry4|entry5|entry6|entry7|entry8|entry9}}
  • entry1
  • entry2
  • entry3
  • entry4
  • entry5
  • entry6
  • entry7
  • entry8
  • entry9
{{hlist|Winner|Runner-up|Third place|item_style=color:blue;}}
  • Winner
  • Runner-up
  • Third place
{{hlist|Winner|Runner-up|Third place|item_style=color:blue;|indent=2}}
  • Winner
  • Runner-up
  • Third place
{{hlist|Winner|Runner-up|Third place|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
  • Winner
  • Runner-up
  • Third place

Template:Unbulleted list and Template:Bulleted list

Vertical list with and w/o bullets, control wrapping
Bulleted
{{bulleted list |item1 |item2 |...}}
  • item1
  • item2
  • ...
Unbulleted
{{unbulleted list|first item|second item|third item|...}}
Syntax
{{unbulleted list
|first item|second item|third item|...
|class     = class
|style     = style
|list_style  = style for ul tag
|item_style  = style for all li tags
|item1_style = style for first li tag |item2_style = style for second li tag |...
}}
Controlling line-breaking

Template {{nbsp}} may be used with {{wbr}} and {{nowrap}} to control line-breaking in bulletless lists, to prevent wrapped long entries from being confused with multiple entries. See Template:Wbr/doc#Controlling line-breaking in infoboxes for details.

Example
Code Result
{{Unbulleted list|entry1|entry2|entry3|entry4|entry5}}
  • entry1
  • entry2
  • entry3
  • entry4
  • entry5
{{Unbulleted list|Winner|Runner-up|Third place|item_style=color:blue;}}
  • Winner
  • Runner-up
  • Third place
{{Unbulleted list|Winner|Runner-up|Third place|item1_style=background-color:yellow;|item2_style=background-color:silver;}}
  • Winner
  • Runner-up
  • Third place
{{Tree list}}
Types
Syntax - Branches
{{Tree list}}
* 1st level branch
** 2nd level branch
*** 3rd level branch
** Another second level branch
** {{Tree list/final branch}} The final second level branch
{{Tree list/end}}
Unlabeled branches

{{Tree list/branching}} and {{Tree list/final branching}}

Examples
Family tree example
Syntax
{{Tree list}}
*[[Image:Simple gold crown.svg|15px]] '''(1)''' [[Henry VII of England|Henry VII]] (1457 - 1509)
**[[Arthur, Prince of Wales]] (1486 - 1502)
**[[Margaret Tudor|Margaret, Queen of Scots]] (1489 - 1541)
***[[James, Duke of Rothesay]] (1507 - 1508)
***[[Arthur, Duke of Rothesay]] (1509 - 1510)
***[[Image:Simple silver crown.svg|15px]] [[James V of Scotland]] (1512 - 1542)
****{{Tree list/final branch}}[[Image:Simple silver crown.svg|15px]] [[Mary, Queen of Scots]] (1542 - 1587)
*****{{Tree list/final branch}}[[Image:Simple silver crown.svg|15px]] [[Image:Simple gold crown.svg|15px]] '''(7)''' [[James VI and I|James VI of Scotland and I of England]] (1566 - 1625)
******{{Tree list/final branch}}''From whom succeeeding English, Scottish and British monarchs are decended.''
***[[Alexander Stewart, Duke of Ross]] (1514 - 1515)
***{{Tree list/final branch}}[[Margaret Douglas|Margaret Douglas, Countess of Lennox]] (1515 - 1578)
**[[Image:Simple gold crown.svg|15px]] '''(2)''' [[Henry VIII of England]] (1491 - 1547)
***[[Henry, Duke of Cornwall]] (1511 - 1511)
***[[Image:Simple gold crown.svg|15px]] '''(5)''' [[Mary I of England]] (1516 - 1558)
***[[Image:Simple gold crown.svg|15px]] '''(6)''' [[Elizabeth I of England]] (1533 - 1603)
***{{Tree list/final branch}}[[Image:Simple gold crown.svg|15px]] '''(3)''' [[Edward VI of England]]
**[[Elizabeth Tudor (daughter of Henry VII)|Elizabeth Tudor]] (1492 - 1495)
**[[Mary Tudor (queen consort of France)|Mary, Queen of France]] (1496 - 1533)
***Henry Brandon (1516 - 1522)
***[[Frances Grey, Duchess of Suffolk]] (1517 - 1547)
****[[Image:Simple gold crown.svg|15px]] '''(4)''' [[Lady Jane Grey]] (1536 - 1553)
****[[Lady Catherine Grey|Catherine Seymour, Countess of Hertford]] (1540 - 1568)
****[[Lady Mary Grey|Lady Mary Keyes]] (1545 - 1578)
****{{Tree list/final branch}}Elizabeth Stokes (1555 - 1556)
***[[Eleanor Clifford, Countess of Cumberland]] (1519 - 1547)
****{{Tree list/final branch}}''From whom are descended the [[Earl of Derby|Earls of Derby]]''
***{{Tree list/final branch}}[[Henry Brandon, 1st Earl of Lincoln]] (1523 - 1534)
**[[Edmund Tudor, Duke of Somerset]] (1499 - 1500) 
**{{Tree list/final branch}}[[Katherine Tudor (1503)|Katherine Tudor]] (1503 - 1503)
{{Tree list/end}}
Cladogram example
Syntax
{{Tree list}}
*[[Tetrapoda]]
** {{Tree list/branching}}
*** De nombreux groupes éteints dont comme les ''[[Eucritta]]''
*** {{Tree list/final branch}} '''[[Lissamphibia]]''' dont les ancêtres des amphibiens actuels
** {{Tree list/final branching}}
*** De nombreux groupes éteints qui rappellent les amphibiens avec des caractéristiques reptiliennes plus ou moins prononcées comme les [[Eoherpetontidae]], les [[Embolomeri]], [[Tokosauridae]], [[Chroniosuchidae]], [[Gephyrostegidae]], [[Solenodonsauridae]], [[Seymouriamorpha]], [[Westlothiana]], [[Lepospondyli]]
*** {{Tree list/final branch}}[[Cotylosauria]]
**** [[Amniota]], à l’origine tous « reptiliens »
**** {{Tree list/final branch}} D’autres taxons frères éteint comme les [[Diadectomorpha]] ou les [[Tseajaiidae]] assez proche des reptiles
{{Tree list/end}}

Collapsible templates

[edit]

{{cot}}

Syntax:

{{cot|TITLE}}
{{cob}}

Template:Collapsible list

Template:Collapsible list (no fill, no border)

Syntax

{{Collapsible list
 | expand = 
 | framestyle = 
 | titlestyle = 
 | title = 
 | liststyle = 
 | hlist = 
 | bullets = 
 | <!-- 1 = -->    <!--(First item in list; the "1 =" is usually not required)-->
 | <!-- 2 = -->    <!--(Second item in list; ditto)-->
 | <!-- 3 = -->    <!--(Third item in list; etc.)-->
 | <!-- etc -->
}}

Parameters

expand Include as |expand=on, |expand=true, etc to set the list's default state to expanded rather than collapsed.
framestyle Custom CSS styling applied the template overall (title and list).
titlestyle Custom CSS styling applied to the title.
title The list's title (always on view beside the list's [show/hide] link).
liststyle Custom CSS styling applied to the list (specifically, to the <ul>...</ul> tags delimiting the list).
hlist Include as |hlist=on, |hlist=true, etc to produce a horizontal rather than vertical list.
bullets Include as |bullets=on, |bullets=true, etc to place a bullet point before each list item.
Unnamed parameters
(first, second, third...)
The list items (in the order in which they will appear). If none are supplied, the template outputs nothing.

Example (no fill, no border):

Help:Collapsing

Collapsible table

To make any table collapsible, add a special class collapsible

For example, the following table is defined with {| class="collapsible wikitable":

Always displayed header
Optionally displayed text; optionally displayed text

Initial state

autocollapse: table will be collapsed if there are more than 2 collapsible tables on the page,
collapsed: table will be initially collapsed.

Example: {| class="wikitable collapsible collapsed"

Table width

{| class="collapsible wikitable" style="width:34em"

Always displayed header, table has width:34em
optionally displayed text: you can see it doesn't matter at all that this is so much longer, table width has been set at 34em

Sortable collapsible table

Sortable table inside a collapsible table:

initially expanded initially collapsed
numbers
name number
a 123
b 6
c 45

Syntax:

{| style="width:40em"
! width=50% | initially expanded !! initially collapsed
|-
|class="collapsible"||class="collapsible collapsed"
|-
|
{| class="collapsible"
!numbers
|-
|
{| class="wikitable sortable"
!name!!number
|-
|a||123
|-
|b||6
|-
|c||45
|}
|}
|
{|class="collapsible collapsed"
!numbers
|-
|
{|class="wikitable sortable"
!name!!number
|-
|a||123
|-
|b||6
|-
|c||45
|}
|}
|}

Table templates

[edit]

WP:USEPROSE

WikiTable

Syntax:

{| class="wikitable"
!Prose!!List with no content
|- valign="top"
| width="50%" | The '''[[20th-century]] [[architecture]] of [[New York City]]''' includes numerous icons of architecture, most notably its striking [[skyscrapers]].  In the first few decades of the century, the city became a center for the [[Beaux-Arts architecture|Beaux-Arts]] movement, represented by architects [[Stanford White]] and [[Carrère and Hastings]]. New York's new skyscrapers included the [[Flatiron Building]] (1902), where Fifth Avenue crosses Broadway at [[Madison Square]]; [[Cass Gilbert]]'s [[Woolworth Building]] (1913), a neo-Gothic "Cathedral of Commerce" overlooking City Hall; the [[Chrysler Building]] (1929), a pure expression of [[Art Deco]]; and the [[Empire State Building]] (1931). Modernist architect [[Raymond Hood]], and [[Lever House]] after World War II, began the clusters of "glass boxes" that transformed the classic skyline of the 1930s, culminating in the [[World Trade Center (1973–2001)|World Trade Center]] towers (1973).
| '''[[20th-century]] [[architecture]] of [[New York City]]'''
* [[Flatiron Building]] (1902)
* [[Woolworth Building]] (1913)
* [[Chrysler Building]] (1929)
* [[Empire State Building]] (1931)
* [[World Trade Center (1973–2001)|World Trade Center]] (1973)
|}

Example:

Prose List with no content
The 20th-century architecture of New York City includes numerous icons of architecture, most notably its striking skyscrapers. In the first few decades of the century, the city became a center for the Beaux-Arts movement, represented by architects Stanford White and Carrère and Hastings. New York's new skyscrapers included the Flatiron Building (1902), where Fifth Avenue crosses Broadway at Madison Square; Cass Gilbert's Woolworth Building (1913), a neo-Gothic "Cathedral of Commerce" overlooking City Hall; the Chrysler Building (1929), a pure expression of Art Deco; and the Empire State Building (1931). Modernist architect Raymond Hood, and Lever House after World War II, began the clusters of "glass boxes" that transformed the classic skyline of the 1930s, culminating in the World Trade Center towers (1973). 20th-century architecture of New York City
Long sequence with 2 columns

Syntax:

{| class="wikitable"
!Prose!!List
|- valign="top"
| width="50%" | [[Philosophy|Philosophers]] discuss the meaning, function, and possibility of offering definitions. It is typical (e.g., in [[college logic]] texts) to distinguish a number of different kinds and techniques of definition, including dictionary or [[lexical definition]], [[intensional definition]], [[extensional definition]], [[ostensive definition]], [[stipulative definition]], [[operational definition]], [[theoretical definition]], [[persuasive definition]], and [[definition by genus and difference]].
| width="50%" | [[Philosophy|Philosophers]] discuss the meaning, function, and possibility of offering definitions. It is typical (e.g., in [[college logic]] texts) to distinguish a number of different kinds and techniques of definition, including:
{{col-begin}}
| width="50%" align="{{{align|left}}}" valign="{{{valign|top}}}" style="border:0"|
* Dictionary or [[lexical definition]]
* [[Intensional definition]]
* [[Extensional definition]]
* [[Ostensive definition]]
* [[Stipulative definition]]
| width="50%" align="{{{align|left}}}" valign="{{{valign|top}}}" style="border:0"|
* [[Operational definition]]
* [[Theoretical definition]]
* [[Persuasive definition]]
* [[Definition by genus and difference]]
{{col-end}}
|}

Example:

Prose List
Philosophers discuss the meaning, function, and possibility of offering definitions. It is typical (e.g., in college logic texts) to distinguish a number of different kinds and techniques of definition, including dictionary or lexical definition, intensional definition, extensional definition, ostensive definition, stipulative definition, operational definition, theoretical definition, persuasive definition, and definition by genus and difference. Philosophers discuss the meaning, function, and possibility of offering definitions. It is typical (e.g., in college logic texts) to distinguish a number of different kinds and techniques of definition, including:

H:COL

Columns without borders

Two columns

Syntax:
{{colbegin}}
{{lorem}}
{{lorem}}
{{colend}}
Produces:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Multiple columns

Syntax:
{{col-begin}}
{{col-break}}
{{lorem}}
{{col-break}}
{{lorem}}
{{col-break}}
{{lorem}}
{{col-end}}
Produces:

{{br list}}

Sortable table

Usage: {{br separated entries|entry1|entry2|entry3|entry4|entry5|...}}

Example
Code Result
{{br separated entries|entry1|entry2|entry3}} entry1
entry2
entry3
{{br separated entries| |entry2|entry3}} entry2
entry3
{{br separated entries|entry1| |entry3}} entry1
entry3
{{br separated entries|entry1|entry2| }} entry1
entry2
{{br separated entries|entry1| | }} entry1
{{br separated entries| |entry2| }} entry2
{{br separated entries| | |entry3}} entry3
{{br separated entries| | | }}
{{br separated entries|entry1|entry2|entry3|entry4|entry5|entry6}} entry1
entry2
entry3
entry4
entry5
entry6

Parameters:

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Permstrump in articles based on its TemplateData.

TemplateData for Permstrump

Creates a <br /> delimited collection of items. Primarily for use in infoboxes, it only adds the <br /> tags where needed.

Template parameters

ParameterDescriptionTypeStatus
First item1

First item, may be null

Stringoptional
Second item2

Second item, many more items can be added

Stringoptional

Help:Collapsing

Collapsible table

To make any table collapsible, add a special class collapsible

For example, the following table is defined with {| class="collapsible wikitable":

Always displayed header
Optionally displayed text; optionally displayed text

Initial state

autocollapse: table will be collapsed if there are more than 2 collapsible tables on the page,
collapsed: table will be initially collapsed.

Example: {| class="wikitable collapsible collapsed"

Table width

{| class="collapsible wikitable" style="width:34em"

Always displayed header, table has width:34em
optionally displayed text: you can see it doesn't matter at all that this is so much longer, table width has been set at 34em

Sortable collapsible table

Sortable table inside a collapsible table:

initially expanded initially collapsed
numbers
name number
a 123
b 6
c 45

Syntax:

{| style="width:40em"
! width=50% | initially expanded !! initially collapsed
|-
|class="collapsible"||class="collapsible collapsed"
|-
|
{| class="collapsible"
!numbers
|-
|
{| class="wikitable sortable"
!name!!number
|-
|a||123
|-
|b||6
|-
|c||45
|}
|}
|
{|class="collapsible collapsed"
!numbers
|-
|
{|class="wikitable sortable"
!name!!number
|-
|a||123
|-
|b||6
|-
|c||45
|}
|}
|}

Talkpage templates

[edit]

WP:Signatures

Image with comment templates
Favs
Tag Renders Tag Renders
{{Autp}} Answered on user's talk page. {{Duck}}  Looks like a duck to me
{{Like}} 👍 Like {{Dislike}} Dislike
{{Done}}  Done {{Done-t}}  Done
{{Great}} thumbs up Great! {{Not sure}} Not sure
{{Orz}} Orz... {{WPcrystalball}}  Wikipedia is not a crystal ball.
{{Suggestion}} question mark Suggestion {{ToDo}}  ToDo
{{Thank}}  Thanks {{You're welcome}} Smiley You're welcome!
{{Thank you very much}}  Thank you very much! {{Sorry}} Smiley Sorry!

Lists

[edit]

Lists of lists

[edit]

Category:Wikipedia templates