Misplaced Pages

:Manual of Style/Tables: Difference between revisions - Misplaced Pages

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Misplaced Pages:Manual of Style Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 08:20, 11 February 2010 edit174.3.98.236 (talk) Discussion started← Previous edit Revision as of 14:13, 11 February 2010 edit undoAnmaFinotera (talk | contribs)107,494 editsm Reverted 2 edits by 174.3.98.236; Rv; no consensus and no wide advertisement of "ideas" - consensus of yourself is not consensus. using TWNext edit →
Line 1: Line 1:
{{subcat guideline|style guideline|When to use tables|WP:ABBR|WP:MOSABBR|MOS:ABBR}} {{style-guideline|WP:WTUT}}
{{dablink|For help with creating tables using Wiki syntax, see ] and ].}} {{for|help with creating tables using Wiki syntax|Help:Table}}
{{style}} {{style}}
Tables can be useful for a variety of content presentation on Misplaced Pages. This page discusses where it makes sense to use tables. For details on how to create tables using wiki markup, see ].

Tables can be useful for a variety of content presentation on Misplaced Pages. This page discusses how tables should be written and where it makes sense to use tables.

==Format==
There are 2 table formats:
*sortable tables
*unsortable tables (this includes tables with merged cells)

The reason there is a clear division between these two types of tables is because even when just 2 cells are merged in any direction, the table becomes unsortable.

*There are tradeoffs for both formats, so use the one that:
**conveys the most information
**is the most clear

==Contents==

*The title of a table, row or column should
**be unambiguous, specific, and terse;
**be ]s or ]s ({{xt|Effects of the wild}}, not {{!xt|About the effects of the wild}});
**not explicitly refer to one another, unless doing so is shorter or clearer; and
**not use {{!xt|''a''}}, {{!xt|''an}}, or {{!xt|''the''}} as the first word ({{xt|Economy of the Second Empire}}, not {{!xt|The economy of the Second Empire}}), unless by convention it is an inseparable part of a name ({{xt|The Hague}}).
*The final visible character of a title should not be a punctuation mark, unless the punctuation is part of a name ({{xt|]}}) or an abbreviation is used ({{xt|]}}).


== When tables are appropriate == == When tables are appropriate ==

Tables are perfect for organizing any information that is best presented in a row-and-column format. This might include: Tables are perfect for organizing any information that is best presented in a row-and-column format. This might include:


Line 39: Line 17:


Often a list is best left as a list. Before you format a list in 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. Often a list is best left as a list. Before you format a list in 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 used simply for layout, either. If the information you are editing is not tabular in nature, it probably does not belong in a table: Try not to use tables for putting a caption under a photograph, arranging a group of links, or other strictly visual features. It makes the article harder to edit for other Wikipedians. Also, when compared with tables, wikimarkup is more flexible, easier to use, and less esoteric when used for desktop publishing, page elements, and page orientation and positioning.


== When tables may not be appropriate == == When tables may not be appropriate ==


=== Simple lists ===
*If a list is simple, it might be better left as a ]. Simple lists do not need the row-and-column format that a table provides. ({{!xt2|<table>
<tr><td>1980</td><td>Ultra Wave</td></tr>
<tr><td>1988</td><td>What's Bootsy Doin'?</td></tr>
<tr><td>1994</td><td>Blasters of the Universe</td></tr>
<tr><td>1994</td><td>Fresh Outta 'P' University</td></tr>
</table>}})


If a list is simple, use one of the standard ]. Simple lists do not need the row-and-column format that a table provides. Here are some examples of things that might be better done with lists instead of tables.
== When tables should not be used ==
{{main|Misplaced Pages:Image use policy|Misplaced Pages:Extended image syntax}}


==== Simple List Table formatting (Don't do this) ====
*Tables should not be used simply for layout. If the information you are editing is not tabular in nature, it probably does not belong in a table. Doing so makes the page harder to edit and wikimarkup should be used instead for data arrangement. Some examples when tables should not be used are:
<blockquote style="background: white; border: 1px solid black; padding: 1em;">
**putting a caption under a photograph
{| class="wikitable"
**arranging a group of links
|1980
**desktop publishing
| Ultra Wave
**page elements
|-
**page orientation and positioning
|1988
**<nowiki>;</nowiki>other strictly visual features.<br />({{xt|<code><nowiki>]</nowiki></code>}}, not {{!xt|<code><nowiki><table align="right" border="0" cellpadding="0"><tr><td>]</td></tr></table></nowiki></code>}})
|What's Bootsy Doin'?
|-
|1994
|Blasters of the Universe
|-
|1994
|Fresh Outta 'P' University
|}
</blockquote>


=== Images === === Layout of images ===


Often images are placed in an article by using a quirk of table rendering. Because a table can be floated to the left or right side of the screen, it has become common practice to use a simple one-celled table to place an image in a particular part of the screen: Often images are placed in an article by using a quirk of table rendering. Because a table can be floated to the left or right side of the screen, it has become common practice to use a simple one-celled table to place an image in a particular part of the screen. This was a necessary workaround for old browsers, since it generates a consistent rendering of images in browsers which do not adequately support ]. However, by far the majority of browsers in use today should do just fine with style sheets. The recommended practice now is to arrange images using an element called <code>div</code>.


For detailed instructions, see ] and the ]. Here's a brief example:
{| align="right"
| ]
|}


==== Table formatting (Do not do this) ====
{{!xt|<code><pre>{| align="right"
<blockquote style="background: white; border: 1px solid black; padding: 1em;">
| ]
<code><nowiki><table align="right" border="0" cellpadding="0"><tr><td>]</td></tr></table></nowiki></code>
|}</pre></code>}}
</blockquote>


==== Without tables (Do this instead) ====
This was a necessary workaround for old browsers, since it generates a consistent rendering of images in browsers which do not adequately support ]. However, by far the majority of browsers in use today should do just fine with style sheets.
<blockquote style="background: white; border: 1px solid black; padding: 1em;">
<code><nowiki>]
</nowiki></code>
</blockquote>

==== How it looks ====
In both of these cases, the result is essentially the same; the image is floated to the right-hand side of the screen, and the surrounding text wraps around it. Here is what it looks like in your browser (with text added):

<blockquote style="background: white; border: 1px solid black; padding: 1em;">
<div style="float:right; margin: 0 0 1em 1em;">]</div>
Covalent bonding is a form of chemical bonding characterized by the sharing of one or more pairs of electrons between atoms, in order to produce a mutual attraction, which holds the resultant molecule together. Atoms tend to share electrons in such a way that their outer electron shells are filled. Such bonds are always stronger than the intermolecular hydrogen bond and similar in strength to or stronger than the ionic bond.

Covalent bonding most frequently occurs between atoms with similar (high) electronegativities, where to completely remove an electron from one atom requires too much energy. Covalent bonds are more common between non-metals, whereas ionic bonding is more common between a metal atom and a non-metal atom.

Covalent bonding tends to be stronger than other types of bonding, such as ionic bonding. Unlike ionic bonds, where ions are held together by a non-directional coulombic attraction, covalent bonds are highly directional. As a result, covalently bonded molecules tend to form in a relatively small number of characteristic shapes, exhibiting specific bonding angles.
</blockquote>


=== Visual layout === === Visual layout ===
Line 78: Line 76:
Multiple columns, positioning, borders, and so on should be done with ]—not tables—when possible. Multiple columns, positioning, borders, and so on should be done with ]—not tables—when possible.


== Recommended table syntax ==
===Content forking===
Use the preformatted '''<nowiki>class="wikitable"</nowiki>''' format, or one of the related formats, instead of manually coding a complex HTML table directly in the article. This will make the table, and the article itself, much easier for other people to edit in the future.
{{main|Misplaced Pages:Content forking}}

Do not make multiple pages of tables when data can be combined into sortable tables.


==See also== ==See also==
* ] (all about how to do tables in Misplaced Pages)
* ] (all about automatic sorting of table rows)
* (about HTML tables and the equivalent wiki code) * (about HTML tables and the equivalent wiki code)



Revision as of 14:13, 11 February 2010

This guideline is a part of the English Misplaced Pages's Manual of Style.
It is a generally accepted standard that editors should attempt to follow, though occasional exceptions may apply. Any substantive edit to this page should reflect consensus. When in doubt, discuss first on the talk page.
Shortcut
For help with creating tables using Wiki syntax, see Help:Table.
Manual of Style (MoS)

Content
Formatting
Images
Layout
Lists
By topic area
Legal
Arts
Music
History
Regional
Religion
Science
Sports
Related guidelines

Tables can be useful for a variety of content presentation on Misplaced Pages. This page discusses where it makes sense to use tables. For details on how to create tables using wiki markup, see Help:Table.

When tables are appropriate

Tables are perfect for organizing any information that is best presented in a row-and-column format. This might include:

  • Mathematical tables
    • Multiplication tables
    • Tables of divisors
    • Lookup tables
  • Lists of information
    • Equivalent words in two or more languages
    • Person, birthdate, occupation
    • Artist, album, year, and label

Often a list is best left as a list. Before you format a list in 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 used simply for layout, either. If the information you are editing is not tabular in nature, it probably does not belong in a table: Try not to use tables for putting a caption under a photograph, arranging a group of links, or other strictly visual features. It makes the article harder to edit for other Wikipedians. Also, when compared with tables, wikimarkup is more flexible, easier to use, and less esoteric when used for desktop publishing, page elements, and page orientation and positioning.

When tables may not be appropriate

Simple lists

If a list is simple, use one of the standard Misplaced Pages list formats. Simple lists do not need the row-and-column format that a table provides. Here are some examples of things that might be better done with lists instead of tables.

Simple List Table formatting (Don't do this)

1980 Ultra Wave
1988 What's Bootsy Doin'?
1994 Blasters of the Universe
1994 Fresh Outta 'P' University

Layout of images

Often images are placed in an article by using a quirk of table rendering. Because a table can be floated to the left or right side of the screen, it has become common practice to use a simple one-celled table to place an image in a particular part of the screen. This was a necessary workaround for old browsers, since it generates a consistent rendering of images in browsers which do not adequately support Cascading Style Sheets. However, by far the majority of browsers in use today should do just fine with style sheets. The recommended practice now is to arrange images using an element called div.

For detailed instructions, see Misplaced Pages:Image use policy and the Misplaced Pages:Extended image syntax. Here's a brief example:

Table formatting (Do not do this)

<table align="right" border="0" cellpadding="0"><tr><td>]</td></tr></table>

Without tables (Do this instead)

]

How it looks

In both of these cases, the result is essentially the same; the image is floated to the right-hand side of the screen, and the surrounding text wraps around it. Here is what it looks like in your browser (with text added):

Covalent bonding is a form of chemical bonding characterized by the sharing of one or more pairs of electrons between atoms, in order to produce a mutual attraction, which holds the resultant molecule together. Atoms tend to share electrons in such a way that their outer electron shells are filled. Such bonds are always stronger than the intermolecular hydrogen bond and similar in strength to or stronger than the ionic bond.

Covalent bonding most frequently occurs between atoms with similar (high) electronegativities, where to completely remove an electron from one atom requires too much energy. Covalent bonds are more common between non-metals, whereas ionic bonding is more common between a metal atom and a non-metal atom.

Covalent bonding tends to be stronger than other types of bonding, such as ionic bonding. Unlike ionic bonds, where ions are held together by a non-directional coulombic attraction, covalent bonds are highly directional. As a result, covalently bonded molecules tend to form in a relatively small number of characteristic shapes, exhibiting specific bonding angles.

Visual layout

Multiple columns, positioning, borders, and so on should be done with CSS—not tables—when possible.

Recommended table syntax

Use the preformatted class="wikitable" format, or one of the related formats, instead of manually coding a complex HTML table directly in the article. This will make the table, and the article itself, much easier for other people to edit in the future.

See also

Categories:
Misplaced Pages:Manual of Style/Tables: Difference between revisions Add topic