Difference between revisions of "UniWiki:Manual of Style/Tables"
(Created page with "{{hatnote|This page discusses when and how tables should be used on Wikipedia. For specific considerations of table style and accessibility, see [[Wikipedia:Manual of Style/Ac...") |
|||
Line 1: | Line 1: | ||
− | {{hatnote|This page discusses when and how tables should be used on | + | {{UMoS guideline}} |
− | + | {{hatnote|This page discusses when and how tables should be used on the UniWiki. For specific considerations of table style and accessibility, see [[UniWiki:Manual of Style/Accessibility/Data tables tutorial]]. For technical guidance on how to create and edit tables, see [[Wikipedia:Help:Table]].}} | |
− | |||
− | Tables are a way of presenting information in rows and columns. They can be useful for a variety of content presentations on Wikipedia, but should be used only when appropriate; sometimes the information in a table may be better presented as prose paragraphs or as an [[ | + | Tables are a way of presenting information in rows and columns. They can be useful for a variety of content presentations on Wikipedia, but should be used only when appropriate; sometimes the information in a table may be better presented as prose paragraphs or as an [[UniWiki:Manual of Style/Embedded lists|embedded list]]. |
− | Avoid referring to tables as being located on the left or right of a display page. Placement | + | Avoid referring to tables as being located on the left or right of a display page. Placement can be different for mobile viewers, and is meaningless to people having pages read to them by assistive software. Instead, use captions to identify tables. |
== Formatting == | == Formatting == |
Revision as of 23:22, 8 January 2017
- This page discusses when and how tables should be used on the UniWiki. For specific considerations of table style and accessibility, see UniWiki:Manual of Style/Accessibility/Data tables tutorial. For technical guidance on how to create and edit tables, see Wikipedia:Help:Table.
Tables are a way of presenting information in rows and columns. They can be useful for a variety of content presentations on Wikipedia, but should be used only when appropriate; sometimes the information in a table may be better presented as prose paragraphs or as an embedded list.
Avoid referring to tables as being located on the left or right of a display page. Placement can be different for mobile viewers, and is meaningless to people having pages read to them by assistive software. Instead, use captions to identify tables.
Formatting
- Main article: Help:Table
It is recommended that wikitables be used in place of HTML tables, as they are easier to customize and maintain. A standard "wikitable style" is available, by adding class="wikitable"
to the top row of the table. The powerful and useful sorting feature can be enabled by adding class="sortable"
to the top row. Extreme caution should be applied if rowspan or colspan is used. It is also possible to combine classes, as in class="wikitable sortable"
.
Captions and headers
Table captions and column and row headers should be succinct and self explanatory. In most cases, individual words or sentence fragments should be used, and thus articles (a, an, the) and sentence-ending punctuation are unnecessary. Only the first word in the caption or header should be capitalized (except for proper nouns), in keeping with Wikipedia's conventions for capital letters. In some rare cases, judicious use of soft hyphens may be helpful; see MOS:HYPHEN for details.
Much of WP:Manual of Style § Article titles, headings, and sections also pertains to table headers: Use sentence case; avoid redundantly including the subject's name in a header; do not put images in the header (including flag icons), unless this is the best way to present tabular information in a particular case; and do not use questions as headers. Title headers are often suitable places for reference citations (e.g., to source a specific row or column of data). Unlike section headings, they often begin with or consist entirely of numbers (such as model numbers, dates, version numbers, etc.). Table headers do not automatically generate link anchors the way section headings do; use the Template:Tlx template to turn a header's text (or part of it) into an anchor.
Appearance
In general, styles for tables and other block-level elements should be set using CSS classes, not with inline style attributes. This is because the site-wide CSS is more carefully tested to ensure compatibility with a wide range of browsers; it also creates a greater degree of professionalism by ensuring a consistent appearance between articles. Deviations from standard conventions are acceptable where they create a semantic distinction (for instance, the infoboxes and navigational templates relating to The Simpsons use a yellow color-scheme instead of the customary mauve, to tie in with the dominant color in the series) but should not be used gratuitously.
See WP:Deviations and Wikipedia talk:Consensus/RfC for guidance on use of coloring or non-standard formatting, and for when MoS and WikiProjects guidance is at variance.
Consideration may be given to collapsing tables which consolidate information covered in the prose.
Accessibility
- Main article: Wikipedia:Manual of Style/Accessibility#Tables
Screen readers and other web browsing tools make use of specific table tags to help users navigate the data contained within tables. Use the correct wikitable pipe syntax to take advantage of all the features available.
See MOS:COLOR for information about restrained use of color in tables, to avoid creating accessibility problems for visually-impaired as well as normal vision readers.
Do not separate items by leaving blank lines between them, even when using unordered or definition lists. The Wikipedia list templates explicitly identify lists for readers, rather than relying on visual formatting to indirectly imply the presence of a list.
Size
Splitting lists and tables per summary style is advised against. Among other problems, arbitrarily splitting a wikitable effectively disables the powerful and useful sorting feature from working across the entire table.
On the other hand, overloading tables with too much detailed statistical data is against policy. Careful thought should be given to how a reader would use a table, and what level of detail is appropriate.
Suitability
Appropriate use
Tables are a way of presenting links, data, or information in rows and columns. They are a complex form of list, formatted into a systematic grid pattern. Tables might be useful for presenting mathematical data such as multiplication tables, comparative figures, or sporting results. They may also be useful for presenting equivalent words in two or more languages; for awards by type and year; complex discographies; etc.
The sortability of multiple columns in a table is a powerful tool that helps the reader to understand relationships and find patterns in large lists. The sortability of tables makes them very useful for "List of..." articles in Wikipedia, which are intended to give an overview of the subject area, and to allow easy comparisons among many similar items. Avoid cramming too much detailed information into individual table entries; if appropriate, the reader should be able to click a Wikilink to read a full, detailed article corresponding to a concise table entry.
Often a list is best left as a list. Before reformatting a list into table form, consider whether the information will be more clearly conveyed by virtue of having rows and columns. If so, then a table is probably a good choice. If there is no obvious benefit to having rows and columns, then a table is probably not the best choice.
Tables should not be misused to resolve visual layout problems. If the information you are editing is not tabular in nature, it probably does not belong in a table: Do not misuse tables for putting a caption under a photograph, arranging a group of links, or other strictly visual features. These practices make the article harder for other Wikipedians to edit, and will likely cause problems when viewed on different display sizes and aspect ratios. Also, when compared with tables, wikimarkup is more flexible, easier to use, and less arcane when used correctly for desktop publishing layout, page elements, and page orientation and positioning.
Examples:
Multi-column sortable standard
Outcome | No. | Year | Championship | Opponent in the final | Score | Ref |
---|---|---|---|---|---|---|
Winner | 1 | 1981 | World Championship | Template:Flagicon Doug Mountjoy | 18–12 | [1] |
Winner | 2 | 1983 | World Championship (2) | Template:Flagicon Cliff Thorburn | 18–6 | [1] |
Winner | 3 | 1983 | International Open | Template:Flagicon Cliff Thorburn | 9–3 | [2] |
Winner | 4 | 1984 | Classic | Template:Flagicon Tony Meo | 9–8 | [3] |
Winner | 5 | 1984 | World Championship (3) | Template:Flagicon Jimmy White | 18–16 | [1] |
Winner | 6 | 1984 | International Open (2) | Template:Flagicon Tony Knowles | 9–2 | [2] |
Winner | 7 | 1984 | UK Championship | Template:Flagicon Alex Higgins | 16–8 | [4] |
Runner-up | 1 | 1985 | World Championship | Template:Flagicon Dennis Taylor | 17–18 | [1] |
Winner | 8 | 1985 | Grand Prix | Template:Flagicon Dennis Taylor | 10–9 | [1] |
Winner | 9 | 1985 | UK Championship (2) | Template:Flagicon Willie Thorne | 16–14 | [4] |
Multi-column standard with subcolumns
Year | Title | Peak chart positions | Certifications | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CAN |
AUS |
AUT |
GER |
NLD |
NOR |
SWE |
SWI |
UK |
US |
North America |
Europe | ||||||||||||||||||
1993 | So Far So Good
|
2 [5] |
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 6 | CA: 6× Platinum US: 5× Platinum |
SW: 4× Platinum UK: 3× Platinum | ||||||||||||||||
1999 | The Best of Me
|
14 | 18 | 4 | 7 | 13 | 2 | 20 | 3 | 12 | — | CA: 3× Platinum | EU: 2× Platinum[6] SW: Platinum UK: Platinum | ||||||||||||||||
2005 | Anthology
|
4 | — | 28 | 30 | — | — | — | 39 | 29 | 65 | CA: 2× Platinum | UK: Gold | ||||||||||||||||
2010 | Icon
|
— | — | — | — | — | — | — | — | — | — | ||||||||||||||||||
"—" denotes releases that did not chart. |
Multi-column mixed sortable unsortable
Year | Title | Role | Notes |
---|---|---|---|
1961 | Barabbas | Patrician in Arena | uncredited |
1962 | Hemingway's Adventures of a Young Man | undetermined role | uncredited |
1963 | Template:Sortname | Janet Trego | TV series, 15 episodes |
1963 | Mister Ed |
|
|
1964 | Template:Sortname | Beautiful Girl | uncredited |
1965 | Template:Sortname | Therapist | TV series, episode: "The Girls of Nazarone Affair" |
1966 | Eye of the Devil | Odile de Caray | |
1967 | Template:Sortname | Sarah Shagal | |
1967 | Don't Make Waves | Malibu | |
1967 | Valley of the Dolls | Jennifer North | |
1968 | Rosemary's Baby | Girl at Party | uncredited |
1968 | Template:Sortname | Freya Carlson | |
1969 | Template:Sortname (also known as 12+1) |
Pat | released posthumously |
Multi-column unsortable
Multi-column unsortable all numeric right justified
× | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
2 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
3 | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
4 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 |
5 | 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 |
6 | 6 | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
7 | 7 | 14 | 21 | 28 | 35 | 42 | 49 | 56 | 63 | 70 |
8 | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 |
9 | 9 | 18 | 27 | 36 | 45 | 54 | 63 | 72 | 81 | 90 |
10 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
Tree (cladogram) left rooted
Template:Cot Template:Clade Template:Cob
Gant (bar graph linear horizontal) with color
Template:Cot <timeline> ImageSize = width:700 height:270 PlotArea = left:100 bottom:60 top:0 right:50 Alignbars = justify DateFormat = mm/dd/yyyy Period = from:01/01/1965 till:12/05/1996 TimeAxis = orientation:horizontal format:yyyy
Colors =
id:Drums value:purple legend:Drums id:Guitars value:green legend:Guitars id:Bass value:gray(0.40) legend:Bass id:Keyboards value:orange legend:Keyboards
Legend = orientation:horizontal position:bottom
ScaleMajor = increment:2 start:01/01/1965
LineData =
at:08/04/1967 color:black layer:back at:06/28/1968 color:black layer:back at:06/13/1969 color:black layer:back at:11/07/1969 color:black layer:back at:10/02/1970 color:black layer:back at:11/05/1971 color:black layer:back at:06/02/1972 color:black layer:back at:03/23/1973 color:black layer:back at:11/12/1975 color:black layer:back at:01/21/1977 color:black layer:back at:11/30/1979 color:black layer:back at:03/21/1983 color:black layer:back at:11/07/1987 color:black layer:back at:03/28/1994 color:black layer:back
BarData =
bar:Mason text:"Nick Mason" bar:Barrett text:"Syd Barrett" bar:Gilmour text:"David Gilmour" bar:Klose text:"Bob Klose" bar:Waters text:"Roger Waters" bar:Wright text:"Richard Wright"
PlotData=
width:10 textcolor:black align:left anchor:from shift:(10,-4) bar:Mason from:01/01/1965 till:end color:Drums bar:Barrett from:01/01/1965 till:06/04/1968 color:Guitars bar:Gilmour from:12/01/1967 till:end color:Guitars bar:Klose from:01/01/1965 till: 12/05/1965 color:Guitars bar:Waters from:01/01/1965 till:01/20/1985 color:Bass bar:Wright from:01/01/1965 till:01/01/1980 color:Keyboards bar:Wright from:01/01/1987 till:end color:Keyboards
</timeline>
Inappropriate use
Simple lists
If a list is simple, it is generally better to use one of the standard Wikipedia list formats instead of a table. Lists are easier to maintain than tables, and are often easier to read.
Here is an example of a simple list using list formatting:
* 1980: Ultra Wave * 1988: What's Bootsy Doin'? * 1994: Blasters of the Universe * 1994: Fresh Outta 'P' Uni
Which produces:
- 1980: Ultra Wave
- 1988: What's Bootsy Doin'?
- 1994: Blasters of the Universe
- 1994: Fresh Outta 'P' Uni
versus table formatting:
{| |1980 |Ultra Wave |- |1988 |What's Bootsy Doin'? |- |1994 |Blasters of the Universe |- |1994 |Fresh Outta 'P' Uni |}
Which produces:
1980 | Ultra Wave |
1988 | What's Bootsy Doin'? |
1994 | Blasters of the Universe |
1994 | Fresh Outta 'P' Uni |
Prose
Prose is preferred in articles as prose allows the presentation of detail and clarification of context, in a way that a table may not. Prose flows, like one person speaking to another, and is best suited to articles, because their purpose is to explain. Tables which are mainly links, which are most useful for browsing subject areas, should usually have their own entries: see Wikipedia:Stand-alone lists for detail. In an article, significant items should normally be mentioned naturally within the text rather than merely tabulated.
Page layout
Page layouts (using multiple columns, positioning elements, adding borders, etc.) should be done via CSS, not tables, whenever possible.
- Images and other embedded media should be positioned using standard image syntax.
- There are several templates available that will create preformatted multi-column layouts: see Help:Columns.
- Other elements can be positioned or given special formatting through the use of the HTML
<div>
element and CSS styling.
See also
- Wikipedia:Table dos and don'ts, a summary of the key points in this guideline
- Help:Table, extensive help
- Help:Table/Introduction to tables, a quick guide to using tables
- Help:Collapsing (show/hide button)
- Wikipedia:Conditional tables
- Wikipedia:Table namespace, an inactive proposal
- Table (HTML)