Wikipedia:When to use tables

From Wikipedia, the free encyclopedia

Shortcut:
WP:HTUT
WP:TABLE

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

Contents

[edit] 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

Many times, a list is best left as a list. Some articles include very long lists which might be difficult to edit if they were in table form. 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, and is not really what tables were designed to do.

[edit] When tables are inappropriate

[edit] Very long lists, or very simple lists

If a list is quite long, or is relatively simple, use one of the standard Wikipedia list formats. Long lists can be hard to maintain if they are inside a table, and 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.

[edit] Table formatting (Don't do this)

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

[edit] 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 Wikipedia:Image use policy and the Wikipedia:Image markup gallery. Here's a brief example:

[edit] Table formatting (Do not do this)

<table align="right" border="0" cellpadding="0"><tr><td>[[Image:Covalent.png]]</td></tr></table>

[edit] Without tables (Do this instead)

[[Image:Covalent.png|right]]

[edit] 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):

Image:Covalent.png

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.

[edit] Visual layout

When possible, visual layout such as multiple columns, positioning, borders, and so on should be done with CSS; not tables.

[edit] See also

  • Help:Table (all about how to do tables in Wikipedia)
  • Table (HTML) (about HTML tables and the equivalent wiki code)