Help:Table

A wikitable is an arrangement of columns and rows used to organize and position data. Tables are useful, and there are many ways and tricks that can be used. By design this page covers only the basics of table usage, more extensive direction and examples are available at MediaWiki Help:Tables and Wikipedia w:Help:Table or w:Wikipedia:Manual of Style/Tables. A section on Wikisource specific formatting for tables used for typography and layout is also included here.

For a better understanding of how tables offer flexible formatting options, adjust the width of your browser window while observing the changes to the examples below. The Complex example is particularly interesting.

Wiki table markup summary

 * The above marks must start on a new line except the double  and   for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
 * XHTML attributes. Each mark, except table end, optionally accepts one or more XHTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
 * Cells and caption ( or ,   or  , and  ) hold content. So separate any attributes from content with a single pipe . Cell content may follow on the same line or on following lines.
 * Table and row marks ( and  ) do not directly hold content. Do not add pipe  after their optional attributes. If a pipe is added improperly after attributes for the table mark or row mark, the parser will delete it and any final attribute that was touching the improper pipe!
 * Content may (a) follow its cell mark on the same line after any optional XHTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
 * Escaping to insert a pipe character into a table use the &lt;nowiki&gt; markup

A simple table


As it appears in a browser:

A more complex example


As it appears in a browser:

Formatting for Effect
This section address the use of tables for the recreation of printed typography and layout on Wikisource. As a general rule Wikisource does not attempt to recreate the identical formatting of the original published work. The conversion from print to electronic formatting means the work will be available on a multitude of different devices with differing screen sizes so for the most part it is counter productive to attempt to recreate to the limitations of printing on paper. At the same time, occasionally a portion of a printed work is created specifically with the limitations of paper in mind, which must be maintained in order to convey the intended meaning to the reader.


 * Template:Table style lists multiple choices for formatting cells, rows and columns in tables. These shortcuts are designed specifically for use on Wikisource.


 * m:Combined use of COLSPAN and ROWSPAN to force alignment, like this



Simple
Good example of table used to force layout used in Wikisource From Page:Latin for beginners (1911).djvu/392

Text
.—— ——

—— —— ——  —— ——  —— ——  —— ——  ——

Tables

 * Design notes
 * 3 columns
 * 9 rows
 * 3 rows / 3 columns wide, center align
 * 1 row / first cell empty / last 2 left align
 * 5 rows / left align


 * Formatting highlights

Moderate
From Page:Latin for beginners (1911).djvu/401

Text
Tense sign -bā- Tense signs I, II, -bi-, III, IV, -ā-, -ē-

Tables

 * Design notes
 * 4 columns
 * 12 rows
 * row 1 / first cell, single / second cell, single / 3&4 join
 * row 2 / first 2 cells empty / last 2 singles
 * row 3-11 column 1 Join (rowspan="9")
 * row 3-5 join column 2 single / last 2 singles
 * row 6-8 join column 2 single / last 2 singles
 * row 9-11 join column 2 single / last 2 singles
 * row 12 / first cell, single / column 2 single / last 2 singles


 * Formatting Highlights (abbreviated version), This example does not add width or height to the empty cells, they are added in the complex example.

Complex
From Page:Latin for beginners (1911).djvu/407

Text
(-bā-) (-erā-)  (-bā-)

(-bi- or -ā- and -ē-) (-eri-) (-bi- or -ā- and -ē-)



Tables

 * Formatting Highlights (abbreviated version),


 * Full Example

Spanning Pages
When a single table spans two printed pages, the desire is to have both pages appear correctly in both the Page: namespace, and when it's transcluded.

Use the header and the footer to close and open the tables in the page name space, when transcluded it will read as one table.

Example: Page:The Works of Lord Byron (ed. Coleridge, Prothero) - Volume 2.djvu/25 has the closing of the first page in the footer. While Page:The Works of Lord Byron (ed. Coleridge, Prothero) - Volume 2.djvu/26 has the opening of the second page in the header. Which causes it to function as one table on The Works of Lord Byron (ed. Coleridge, Prothero)/Poetry/Volume 2/Childe Harold's Pilgrimage.

See: Tables across page breaks

Adding CSS Styles
The Table Style template allows fine-grain styling of tables and table cells. For example sets a cell to have a left dotted border, a double right border, text center aligned and 69% font size.

Other wikis

 * Wiki color formatting help
 * m:Help:Text color
 * m:Help:Reference card
 * w:Help:Wiki markup

da:Hjælp:Tabeller it:Aiuto:Tabelle ml:സഹായം:പട്ടിക tr:Yardım:Tablo