Help:Table

A table is an arrangement of columns and rows that organizes and positions data or images. Tables can be created on Wikipedia pages using special wikitext syntax, and many different styles and tricks can be used to customise them.

Tables can be used as formatting instrument, but consider using a multi column list instead.

Source mode toolbar
To automatically insert a table, click or  (Insert a table) on the edit toolbar. In the Vector toolbar the table icon is in the "Advanced" menu. If "Insert a table" is not on the toolbar follow these directions to add it.

The following text is inserted when Insert a table is clicked:

This code produces the following table:

The sample text ("Header text" or "Example") is intended to be replaced with actual data. You can fill in the table while in source mode. Or use the visual editor (VE).

Visual editor
With the visual editor (VE) you directly fill in the cells without having to go through wikitext. VE makes it easy to add or delete rows or columns. In VE this is what shows up when clicking the table icon (in the "Insert" menu):

In addition, it is usually possible to add or import a table that exists elsewhere (e.g., in a spreadsheet, on another website) directly into the visual editor by:
 * dragging and dropping a .csv file into the visual editor, or
 * selecting, copying, and pasting the table into the visual editor.

Basic table markup

 * The above marks must start on a new line, except the double marks ( and  ) for optionally adding consecutive cells to a single line.
 * Blank spaces at the beginning of a line are ignored.
 * Content may either follow its cell mark on the same line (after any optional HTML attributes); or on lines below the cell mark (beware of undesired paragraphs though). Content that uses wiki markup that itself needs to start on a new line, such as with lists, headings, or nested tables, must be on its own new line.
 * To insert a pipe character into a table caption or cell, use the   escaping markup.

HTML attributes
Each mark, except table end, optionally accepts one or more attributes. Attributes must be on the same line as the mark.


 * Cells and captions ( or ,   or  , and  ) hold content—separate any attribute from its content with a single pipe , with attributes preceding content.
 * Table and row marks ( and  ) do not directly hold content. Do not add a pipe  after any attributes.

Commonly included attributes in tables include:, for example  ;  , for CSS styling;  , to indicate row or column header cells;  , to extend cells by more than one row;  , to extend cells by more than one column.

Pipe syntax tutorial
Although HTML table syntax also works, special wikicode can be used as a shortcut to create a table. The vertical bar or "pipe" symbol codes function exactly the same as HTML table markup, so a knowledge of HTML table code helps understand pipe code. The shortcuts are as follows:

The entire table is encased with curly brackets and a vertical bar character (a pipe). So use  to begin a table, and   to end it. Each one needs to be on its own line:

 {|    table code goes here  |} 

An optional table caption is included with a line starting with a vertical bar and plus sign " " and the caption after it:

To start a new table row, type a vertical bar and a hyphen on its own line: " ". The codes for the cells in that row start on the next line.

Type the codes for each table cell in the next row, starting with a bar:

Cells can be separated with either a new line and a single bar, or by a double bar " " on the same line. Both produce the same output:

Wikitext

Produces

Optional parameters can modify the display and styling of cells, rows, or the entire table. The simplest way to add styling is to set the  CSS class, which in Wikipedia's external style sheet is defined to apply a gray color scheme and cell borders to tables using it:

Wikitext

Produces

The table parameters and cell parameters are the same as in HTML, see http://www.w3.org/TR/html401/struct/tables.html#edef-TABLE and Table (HTML). However, the, , , , and elements are currently not supported in MediaWiki,.

A table can be useful even if none of the cells have content. For example, the background colors of cells can be changed with cell parameters, making the table into a diagram, like meta:Template talk:Square 8x8 pentomino example. An "image" in the form of a table is much more convenient to edit than an uploaded image.

If all the cells in a row are empty the cells still show up. If the header cell is also empty for that row all the cells show up, but they are narrow. That can be fixed with a simple  in one of the cells. That is what is done here:
 * Help:Sortable tables

Each row must have the same number of cells as the other rows, so that the number of columns in the table remains consistent.

With  and   cells can span several columns or rows;

Rendering the pipe
When cell content that contains a pipe character does not render correctly, simply add an empty format for that cell. The second pipe character in a line of  will not display; it is reserved for adding a format. Wikicode between the first and second pipe is a format, but since emptiness or an error there is ignored, it just disappears. When this happens, add a dummy format. Use a third pipe character to render your first pipe character.

Rendering the first pipe when it is the third pipe in the cell code.

Wikitext

Produces

The third and later pipe characters will render, but to display two adjacent pipe characters in a cell, (instead of having them act as the first pipe at the start of a new cell), other pipe-rendering options are needed. Instead of using a dummy format to render a pipe, you can render it directly by 1)  (preferred) or 2) html:   or. Each line of cell code in the following table has one wikicode pipe.

Displaying adjacent pipes

Wikitext

Produces

Template !, because of the order in which things are parsed, is equivalent to typing in a single | pipe character. The single  parser-tag does not apply here. See how they do not escape the second pipe, as &amp;#124 and  did above:

Common mechanisms that do not work in tables.

Wikitext

Produces

Scope
Column headers are identified by  instead of. Row headers are identified by  instead of. Each header cell should be on a separate line in the wiki-markup. The  and   markup should be used for column and row headers in all data tables because it explicitly associates the header with the corresponding cells, which helps ensure a consistent experience for screen readers. The Manual of Style requires the use of scope for column and row headers.

For complex tables, when a header spans two columns or rows, use  or   respectively to clearly identify the header as a column header of two columns or a row header of two rows. When headers are unclear, this can cause accessibility issues; therefore, use  to set a unique value without spaces on each header, then reference the id(s) on the data cells that have unclear headers using   with a space separating each id.

Header cells typically render differently from regular cells, depending on the browser. They are often rendered in a bold font and centered. If this rendering is not desired from an aesthetic point of view, the table can be styled with the "plainrowheaders" class which left-aligns the row headers and removes the bolding. Left-alignment of row headers only occurs if  and   are both used.

A typical example may be marked up like this:

Wikitext

Produces

Row headers
Note that with row headers you need to use a separate row in the wikitext for the row header cell. See the correct format in the last table in the previous section. Note the use of single and double pipes (bars).

Here below is what the same table (without ) looks like if the data cell wikitext is on the same line as the row header wikitext. Note that the data cell text is bolded, and the data cell backgrounds are the same shade of gray as the column and row headers. Data cells should normally have plain unbolded text, and a lighter background.

Wikitext

Produces

Minimalist table
Both of these generate the same output. Choose a style based on the number of cells in each row and the total text inside each cell.

Wikitext

Produces (note that there are no borders).

Multiplication table
Note that in this example  is used to style the table with Wikipedia's external style sheet for tables. It adds borders, background shading, and bold header text.

Wikitext

Produces

Width
''Note:  is obsolete in HTML 5, and so it could eventually be ignored by MediaWiki. See: HTML 5. Use CSS styles instead: Such as  or   or other CSS units. Number by itself signifies pixels.''

See width examples on this subpage. There it is easier to narrow the browser window and not lose one's place as on a long page such as here on Help:Table. Overall table width does not act the same on Wikipedia mobile view as it does on mobile view on webpages outside Wikipedia. See the subpage examples.

Setting widths is discouraged for the most part on Wikipedia because it interferes with the ability of the browser to adjust content to suit the browser window, device size, zoom settings, user-end font size choices, and other constraints. Verbose notes columns are almost always a problem, especially when there are more than a few other columns. Editors frequently try to make the notes column wider, which messes up the other columns. For this reason, verbose notes columns should be avoided, or the notes should be shortened and links to longer notes below the table should be added instead.

  can be used in table headers. The following table excerpt is adapted from this version of List of countries by wealth per adult. The goal is to narrow the data columns, and have the country names spread out on one line each. All of this makes it easier when scanning down a country list. But the country names have to wordwrap if needed (in narrow portrait views on some cell phones, etc.). So   was used in selected column heads. It also avoids using header line breaks  which annoy people using screen readers due to the pauses. Em units are good because they increase in size along with the zoom setting. It is important to check if the max-width you have chosen also works correctly in cell phones, and is not breaking words. You may need to increase it a bit. Here is the relevant header wikitext:

Wikitext Produces

sort under narrows the table columns further:

If using sticky header, then for cell phones even narrower headers are better:

Here below is what the table looks like without   and without a caption. Narrow your browser window to see how the table below contracts versus the ones above. The table above (even if some more columns are added) maintains one line per country for narrower browser and screen widths. So it is therefore more readable and scannable in long country tables. The table format below can greatly increase in number of lines, and require more vertical scrolling, especially if more columns are added.

Setting column widths. Other methods
To force initial column widths to specific requirements, rather than accepting the width of the widest text element in a column's cells, follow this example. Note that wrap-around of text is forced for columns where the width requires it. Do not use

Wikitext

Produces

To set column widths in a table without headers, specify the width in the first cell for each column.

Wikitext

Produces

You can also use percentages, such as  to equalize the widths of a two-column table.

One application of setting the widths is aligning columns of consecutive tables. The following are separate tables, with columns set to 350px and 225px.

Wikitext

Produces

Height
The height of the whole table can be specified, as well as the height of a row. The height of the middle row below is set to  and the total height of the whole table is set to   units. Doing the math shows that the height of the top and bottom rows are 3.5 em units each. 3.5 + 3.5 + 7 = 14. If there is wordwrap then the height will increase to accommodate this (except on mobile where the bottom of the table will be cut off).

Wiki markup

Produces

Captions and summaries
Explicit table captions (or titles) are recommended for data tables as a best practice; the Wikipedia Manual of Style considers them a high priority for accessibility reasons (screen readers), as a caption is explicitly associated with the table, unlike a normal wikitext heading or introductory sentence. All data tables on Wikipedia require captions. A caption is provided with the  markup, similar to a table row, but it does not contain any cells, and is not within the table border. Captions are always displayed, appearing as a title centered (in most browsers), above the table. A caption can be styled (with inline, not block, CSS), and may include wikilinks, reference citations, etc.

A provides an overview of the data of a table for text and audio browsers, and does not normally display in graphical browsers. The summary (also a high Manual of Style priority for tables) is a synopsis of content, and does not repeat the caption text; think of it as analogous to an image's  description. A summary is added with, on the same line as the   that opened the table, along with any   and other parameters for the table as a whole. The  attribute is, however, obsolete in HTML 5.

Wiki markup example showing left-aligned caption with a source citation:

Produces

Colspan and rowspan
It is possible to create cells that stretch over two or more columns. For this, one uses. Similarly, one can create cells that stretch over two or more rows. This requires. In the table code, one must. The resulting column- and row-counting must fit.

Wikitext

Produces

In the code, the cell  spans two columns. Note that, in the next column,.

Similar: in the code, cell  spans two rows. .

Wikitext

Produces

Note that using  for cell G combined with   for cell F to get another row below G and F won't work, because all (implicit) cells would be empty.

Below is the same table with the order of the declared rows and cells shown in parentheses. The uses of  and   are also shown.

Wikitext
 * colspan=2 style="text-align: center;" | B (row 2 cell 2)
 * C (row 3 cell 1)
 * D (row 3 cell 2)
 * E (row 4 cell 1)
 * rowspan=2 colspan=2 style="text-align: center;" |F (row 4 cell 2)
 * G (row 5 cell 1)
 * colspan=3 style="text-align: center;" | H (row 6 cell 1)
 * }
 * G (row 5 cell 1)
 * colspan=3 style="text-align: center;" | H (row 6 cell 1)
 * }
 * }

Produces Note that although cell C is in column 2, C is the 1st cell declared in row 3, because column 1 is occupied by cell A, which was declared in row 2. Cell G is the only cell declared in row 5, because cell F occupies the other columns but was declared in row 4.

Setting borders
''Note: HTML 5. CSS to replace obsolete attributes for borders, padding, spacing, etc.''

Add a border around a table using the CSS property, for example. This example uses a solid (non-dashed) gray border that is one pixel wide:

Wikitext

Produces Note the bottom-row texts are centered by  while the star images are not centered (i.e. left aligned).

As long as the  specs omit the parameter   they don't show the caption lines in the table (only during mouse-over). The border color  matches typical tables or infoboxes in articles; however, it could be any color name (as in  ) or use a hex-color (such as:  ).

Borders of every cell
Wikitext

Produces

If all cells have the same border color, the resulting double borders may not be wanted; add the  CSS property on the table opening tag to reduce them to single ones (  is obsolete).

Additionally, the W3C allows the use of the otherwise obsolete  attribute on the table root  if its value is "1". This adds a one-pixel border, in the default color, to the table and all of its cells at once:

Using the  property to combine the double borders, as described above:

Wikitext

Produces

Float table left or right
Two table classes  and   (case sensitive) help floating the table and adjusting table margins so that they do not stick to the text. floats the table to the left and adjusts right margin. does the opposite. Example:

Wikitext

As it appears in a browser: This paragraph is before the table. The text in column 2 spans both rows because of format specifier "rowspan=2" so there is no coding for "Col 2" in the 2nd row, just Col 1 and Col 3. Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?

Note that although there are other ways to float a table, such as,  , the only parameters that allow you to position the table under a floated multimedia object are   and. For example:

Aligning the table with the   class produces:

Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?

But aligning it with  produces:

Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?

Centering tables
is deprecated in HTML5, and does not work well in Mediawiki software. For example; it will not override the left alignment of tables via.

Centered tables can be achieved, but they don't "float"; that is to say, no text appears to either side. The trick is

Wikitext

As it appears in a browser: Text before table... ...text after table.

Nested tables
Nesting data tables with header cells makes it difficult for assistive screen readers to parse them sensibly.

Editors sometimes use headerless tables as an aid to content layout, especially where it is easier than the equivalent use of divs and CSS styling. For complex layouts,  and   may be used, but again it is sometimes simpler and more maintainable to use nested tables.

In the following example, five different tables are shown nested inside the cells of a sixth, main table. None has any header cells. Automatically, the two tables |A| and |B|B| are vertically aligned instead of the usual side-by-side of text characters in a cell. is used to fix each of tables |C| and |D| to their own position within one cell of the table. This may be used for charts and schematics.

Wikitext:

Colors in tables
Two ways of specifying color of text and background for a single cell are as follows:

Wikitext

Produces

Like other parameters, colors can also be specified for a whole row or the whole table; parameters for a row override the value for the table, and those for a cell override those for a row.

There is no easy way to specify a color for a whole column: each cell in the column must be individually specified. Tools can make it easier.

Wiki markup

Produces

To make the table blend in with the background, use  or. (Warning:, does not work with some older browsers, including IE6, so ensure that the table will be intelligible if the coloring preference fails.)

To force a cell to match one of the default colors of the  template, use    for the darker header, and    for the lighter body. #A2A9B1 is the wikitables border color.

Background colors for column headers
  works in sortable header cells.   does not. It breaks sorting in that cell. See Help:Sortable tables. So use  for all column header cells whether currently sortable or not. Someone may attempt to make them sortable later.

Setting cell parameters
At the start of a cell, add your parameter followed by a single pipe. For example,  sets that cell to a width of 300 pixels. To set more than one parameter, leave a space between each one.

Wikitext

Produces

Vertical alignment in cells
By default, text is aligned to the vertical middle of the cell:

To align the text to the top of the cell, apply the  CSS to the rows (unfortunately, it seems to be necessary to apply this individually to every single row). The  attribute is deprecated and MediaWiki may stop using it.

Wikitext Produces

Cell content indenting and padding
The contents of a cell can be indented or padded on any side. Also, the text can be aligned. In the second row the text is aligned to the right. See the following examples.

Wikitext

Produces

Pattern for arguments: The arguments to  can be seen as being ordered by a 12-hour clock, starting at noon and going clockwise, in the following sense: "top" is associated with noon (i.e. 12 o'clock, the top of a clock), "right" is 3 o'clock, "bottom" is 6 o'clock, and "left" is 9 o'clock. The arguments are ordered clockwise starting at noon: top &rarr; right &rarr; bottom &rarr; left (see this footnote for an example with an explanation).

This same order is also used elsewhere, such as when specifying a cell's borders with.

Setting default cell padding

Use  to set the default padding for each cell in a table. If  is used then   is ignored. The default space between cells can be changed using.

If  is not used

Wikitext

Produces

Using :

Wikitext

Produces

Using :

Wikitext

Produces

Using  and  :

Wikitext

Produces

Individual cell borders
The same CSS used for tables can be used in a cell's format specifier (enclosed in ... ) to put a border around each cell:

Wikitext

Produces

Note that only the image cells have individual borders, not the text. The lower hex-colors (such as: ) are closer to black. Typically, all borders in a table would be one specific color.


 * Border styles

The  and   properties can accept the following arguments:


 * Borders of a cell using,  ,  ,

Wikitext border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;
 * style="border-top: solid 2px red; border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;" | border-top: solid 2px red;
 * style="border-top: solid 2px red; border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;" | border-top: solid 2px red;
 * }

Produces


 * Top, right, bottom, and left borders of a cell using

To set the left, right, bottom, or top border of a single cell, one may use  which takes between 1 and 4 arguments, each of which is either ,  ,  ,  ,  ,  ,  ,  ,  ,  , or.

These arguments are ordered according to the pattern described here. For instance,  where the four parameters correspond respectively to the borders of the cell. For reasons described after this example, there are many ways to change the following that would  result in any changes to the table that is actually.

Wikitext

Produces

Note, however, that in the following table, none of the central cell's (i.e. 's) borders are removed despite the code  :

Wikitext

Produces

This happens because the code  places a border (top, right, bottom, and left) around  cell in the table so that, for instance, there are actually  borders between the cells "Middle_Center" and "Middle_Right". So to remove the border between cells "Middle_Center" and "Middle_Right", it is necessary to remove both the right border of "Middle_Center" the left border of "Middle_Right":

Wikitext

Produces

To remove selected external borders of a wikitable, both remove them from the adjacent cells and begin the whole table with code like.

Note that replacing  with has the effect of removing all cell borders that would otherwise appear by default around every cell in the table. With this change, you must a  cell border between two adjacent cells rather than remove  cell borders.

Row numbers
See Help:Sortable tables sections on row numbers. And:
 * Template:Static row numbers
 * Template:Row numbers

Nowrap
In a table that spans the entire width of a page, cells narrower than the widest cell tend to wrap. To keep an entire column from wrapping, use  in a non-header cell on the longest/widest cell to affect the entire column. This is not a good idea though, because in cell phones the column will not wrap, and part of the table may extend past the screen (especially in portrait view).

Without, as it appears in a browser:

Wikitext

Produces

With, on both the Episode and Date columns, as it appears in a browser:

Wikitext

Produces

Tooltips
You can add tooltips to columns by using the Tooltip template. Simply replace the column-title with, which makes it appear like so: Column title.

Non-rectangular tables
can be used to diagonally split a header cell, as in the top-left cell in the rendered result below:

Wikitext Produces

Cell borders can be hidden by adding to style attributes of either table or cell (may not work in older browsers). Another use is to implement multi-column aligned tables.

Wikitext Produces

Wikitext Produces

Row template
Regardless of whether wikitable format or HTML is used, the wikitext of the rows within a table, and sometimes even within a collection of tables, may have much in common, e.g.: In such a case, it can be useful to create a template that produces the syntax for a table row, with the data as parameters. This can have many advantages:
 * the basic code for a table row
 * code for color, alignment, and sorting mode
 * fixed texts such as units
 * special formats for sorting
 * easily changing the order of columns, or removing a column
 * easily adding a new column if many elements of the new column are left blank (if the column is inserted and the existing fields are unnamed, use a named parameter for the new field to avoid adding blank parameter values to many template calls)
 * computing fields from other fields, e.g. population density from population and area
 * duplicating content and providing span tags with  for the purpose of having one format for sorting and another for display
 * easy specification of a format for a whole column, such as color and alignment

Example:

Using

Wikitext

Produces

Conditional table row
For a conditional row in a table, we can have:

Wikitext

Produces

With comments to explain how it works, where note how the second row is missing:

Wikitext

Produces

Classes
There are several other CSS classes, besides the basic, documented above.

In the first line of table code, after the, instead of specifying a style directly, you can also specify a CSS class, which may be used to apply styles. The style for this class can be specified in various ways:
 * in the software itself, per skin (for example the class sortable)
 * collectively for all users of one wiki in MediaWiki:Common.css (for example, on this and some other projects there is or was the class wikitable, later moved to shared.css)
 * separately per skin in MediaWiki:Monobook.css etc.
 * individually on one wiki in a user subpage
 * individually, but jointly for tables of the class concerned on all web pages, on the local computer of the user.

Instead of remembering table parameters, you just include an appropriate class after the. This helps keep table formatting consistent, and can allow a single change to the class to fix a problem or enhance the look of all the tables that are using it at once. For instance, this:

Wikitext Produces

becomes this:

Wikitext Produces

simply by replacing inline CSS for the table by. This is because the  class in MediaWiki:Common.css contains a number of   CSS style rules. These are all applied at once when you mark a table with the class. You can then add additional style rules if desired. These override the class's rules, allowing you to use the class style as a base and build up on it:

Wikitext Produces

Notice that the table retains the gray background of the  class, and the headers are still bold and centered. But now the text formatting has been overridden by the local  statement; all of the text in the table has been made italic and 120% normal size, and the wikitable border has been replaced by the red dashed border.

Other table syntax
The types of table syntax that MediaWiki supports are:
 * 1) Wikicode   syntax
 * 2) HTML (and XHTML)
 * 3) Mixed XHTML and wikicode (Do not use)

All three are supported by MediaWiki and create (currently) valid HTML output, but the pipe syntax is the simplest. Mixed HTML and wikicode  syntax (i.e., unclosed   and   tags) don't necessarily remain browser-supported in the future, especially on mobile devices.

See also HTML element. Note, however, that the,  ,  ,  , and   elements are currently not not supported in MediaWiki,.

Table syntax comparison
! scope="row" | Pros ! scope="row" | Cons
 * - style="vertical-align: top;"
 * Can preview or debug with any XHTML editor
 * Can be indented for easier reading
 * Well-known
 * Insensitive to newlines
 * No characters like "|", which can collide with template and parser function syntax
 * Easy to write
 * Easy to read
 * Takes little space
 * Can be learned quickly
 * - style="vertical-align: top;"
 * Can be learned quickly
 * - style="vertical-align: top;"
 * Tedious
 * Takes a lot of space
 * Difficult to read quickly
 * Debugging more difficult because of tag pairing requirements
 * Indented code might not match nesting.
 * Confusing newline behaviour as they only occasionally break cells.
 * Unfamiliar syntax for experienced HTML editors
 * Rigid structure
 * Cannot be indented for clarity
 * HTML tag text may be easier to read than pipes, plus signs, dashes, etc.
 * Requires using to pass a   character in a parameter.
 * Sensitive to newlines; see Help:Newlines and spaces.
 * }
 * Sensitive to newlines; see Help:Newlines and spaces.
 * }

Pipe syntax. HTML output
The pipe syntax, developed by Magnus Manske, substitutes pipes and other symbols for HTML. There is an online script, which converts HTML tables to pipe-syntax tables.

The pipes must start at the beginning of a new line, except when separating parameters from content or when using  to separate cells on a single line. The parameters are optional.

Tables
A table is defined by, which generates .

Rows
For each table, an HTML tag is generated for the first row. To start a new row, use: |- which generates another.

Parameters can be added like this: |- params which generates.

Note:
 * tags are automatically opened before the first equivalent
 * tags are automatically closed at another equivalent and at the  equivalent

Cells
Cells are generated either like this: |cell1 |cell2 |cell3 or like this: |cell1||cell2||cell3 which both generate: cell1cell2cell3. The  equals a newline +.

Parameters in cells can be used like this: |params|cell1||params|cell2||params|cell3 which results in: cell1 cell2 <td >cell3</td>

Headers
The code used produces a <th ></th>, functioning the same way as <td ></td>, but with different style and semantic meaning. A  character is used instead of the opening , and   can be used like  , to enter multiple headers on the same line. Parameters still use "|", though. Example: ! params|cell1

Captions
A tag is created by which generates the HTML <caption >caption</caption>.

You can also use parameters: |+ params|caption which generates <caption >caption</caption>.

Table cell templates
See Table cell templates for a large set of templates to configure text and color in cells in a standard way, producing stock output. For example: "Yes", "No" , "—" , "N/A" , "?" , on colored backgrounds.

For example, see Comparison of text editors, which makes frequent use of table cell templates.

Vertical column headers
Sometimes it is desirable (such as in a table predominantly made of numbers) to rotate text such that it proceeds from top to bottom or bottom to top instead of from left to right or right to left. This can be done with CSS but the easiest way on Wikipedia is to enclose the text of each heading in a vertical header template. For example: If the text includes an equals sign then replace it with.

Indenting tables
While tables should not normally be indented, when their surrounding paragraphs are also indented, you can indent tables using.

To achieve the same indentation as a colon, use.

Wikitext

Produces

Tables on talk pages
Note that indentation applied to only the first line of the table wikitext (the line that begins with " ") is sufficient to indent the entire table.

Do not attempt to use colons for indentation anywhere within the rest of the table code (not even at the beginning of a line), as that will prevent the MediaWiki software from correctly reading the code for the table.

Templates

 * Category:Table templates: all the templates that effect or use tables.
 * Category:Multi-column templates: templates for using columns without tables.
 * Category:Chart, diagram and graph templates
 * Category:Chart, diagram and graph formatting and function templates
 * Category:Wikipedia template editors
 * List to table: template and its maintenance category: Category:Articles requiring tables
 * Horizontal TOC: good for country lists in table format.
 * Table: template for specifying table CSS classes such as "wikitable" and "collapsible"
 * Alternating rows table
 * Aligned table: for specifying tables as a template, allowing inclusion in other templates and areas where table syntax is problematic.
 * Examples:
 * Chess diagram: chess board template.
 * Goban: Go board template.

Wikimedia sister projects

 * mw:Help:Tables: MediaWiki help page on tables.
 * Wiki markup tables: Meta-Wiki information on tables.
 * m:Help:Sorting: Meta-Wiki information on sortable tables.
 * Table background colors: MediaWiki background colors table.
 * Commons:Chart and graph resources: Chart and graph resources at Commons
 * Commons:Convert tables and charts to wiki code or image files: includes information on converting table markup.
 * Commons:Template:SVG Chart. Convert list/table to SVG line chart.
 * Commons. Convert US list/table to state-by-state SVG map.
 * Commons:Template:SVG Chart. Convert list/table to SVG line chart.
 * Commons. Convert US list/table to state-by-state SVG map.