Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Table
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|How to create and use tables in markup}} {{Table help}} {{Wikipedia how to|H:TABLE}} {{Wiki markup}} <templatestyles src="Help:Table/styles.css" /> A [[table (information)|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, or [[HTML element#Tables|HTML syntax]], and many different styles and tricks can be used to customise them. == Tools == === Source mode toolbar === <div class=grid> [[File:WikiEditor-advanced menu-en table.png|frame|none|Vector toolbar – default. Table icon [[File:Vector toolbar insert table button new.png|25px]] is circled.]] </div> <div class=grid> [[File:Toolbar2.PNG|frame|none|Monobook toolbar. Table icon [[File:Button insert table.png]] is on the right end.]] </div> To automatically insert a table, click [[File:Vector toolbar insert table button new.png|25px]] or [[File:Button insert table.png]] (Insert a table) on the [[Help:Edit toolbar|edit toolbar]]. In the Vector toolbar the table icon is in the "Advanced" menu. The following wikitext is inserted when '''Insert a table''' [[File:Vector toolbar insert table button new.png|25px]] is clicked. <syntaxhighlight lang=wikitext class=gridbox> {| class="wikitable" |+ Caption text |- ! Header text !! Header text !! Header text |- | Example || Example || Example |- | Example || Example || Example |- | Example || Example || Example |} </syntaxhighlight> The sample text ("Header text" or "Example") is intended to be replaced with actual data. Row numbers (1-3) and column letters (A-C) have been substituted below to help visualization. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class="wikitable" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |- | row 3 A || row 3 B || row 3 C |} </syntaxhighlight> </div> <div class="box"> '''Produces:''' {| class="wikitable" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |- | row 3 A || row 3 B || row 3 C |} </div> You can fill in the table while in source mode. Or use the visual editor (VE). To create more complex table structures in source mode with cells that span multiple rows or columns, see {{slink||Colspan and rowspan}}. === Visual editor === {{hatnote|See: [[Help:Tables and VisualEditor]]. And: [[Help:Creating tables#Tables and visual editor]].}} With the [[Wikipedia:Visual Editor|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): {| class="wikitable" |+ ! ! ! ! |- | | | | |- | | | | |- | | | | |} For more complex table structures, Visual editor offers cell-merging operations; see details [[Help:Introduction to tables with VisualEditor/2|here]]. 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. === Using other tools === {{See also|Help:Creating tables#Spreadsheet/database tables to wikitables|Wikipedia:Tools#Importing (converting) content to Wikipedia (MediaWiki) format|label 1=Help:Creating tables § Spreadsheet/database tables to wikitables|label 2=Wikipedia:Tools § Importing (converting) content to Wikipedia (MediaWiki) format}} Other tools, such as those used to create wiki tables from Excel, can be used to create wikitable markup from spreadsheet and database tables. See [[Help:Table#External links|§ External links]] for a list of some. == Table basics == Tables can be added to articles and other pages using either standard [[HTML element#Tables|HTML table elements]], or with special [[wikicode]] markup developed just to facilitate creating tables without a knowledge of HTML. === Markup === {{See also|Help:Basic table markup}} {{mw-datatable}} {| class="wikitable mw-datatable" |+Overview of basic table markup |- ! scope="col" | Table element ! scope="col" | Wikitext ! scope="col" | Required ! scope="col" | Usage notes |- ! scope="row" | Table start | {{kbd|<nowiki>{|</nowiki>}} | '''Required''' | Note: {{kbd|<nowiki>{|</nowiki>}} Entire table goes here {{kbd|<nowiki>|}</nowiki>}} |- ! scope="row" | Caption | {{kbd|<nowiki>|+</nowiki>}} | Optional | Only between table start and first table row. |- ! scope="row" | Row | {{kbd|<nowiki>|-</nowiki>}} | Optional | Can be omitted before the first row. |- ! scope="row" | Header cell | {{kbd|<nowiki>!</nowiki>}} or {{kbd|<nowiki>!!</nowiki>}} | Optional | Consecutive table header cells may be added on the same line separated by double marks (<code>!!</code>); or start on new lines, each with its own single mark (<code>!</code>). |- ! scope="row" | Data cell | {{nowrap|{{kbd|<nowiki>|</nowiki>}} or {{kbd|<nowiki>||</nowiki>}}}} | Optional | Consecutive table data cells may be added on the same line separated by double marks (<code><nowiki>||</nowiki></code>) or start on new lines, each with its own single mark (<code><nowiki>|</nowiki></code>). This mark is also used to separate [[HTML attribute]]s from cell and caption contents. |- ! scope="row" | Table end | {{kbd|<nowiki>|}</nowiki>}} | '''Required''' | |} *The above marks must ''start on a new line'', except the double marks (<code>||</code> and <code>!!</code>) 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'' (<code>|</code>) into a table caption or cell, use the <code><nowiki>|</nowiki></code> escaping markup. ===HTML attributes=== Each mark, except table end (<code><nowiki>|}</nowiki></code>), optionally accepts one or more ''[[HTML attribute|attributes]]''. Attributes must be on the same line as the mark. *''Cells'' and ''captions'' (<code>|</code> or <code>||</code>, <code>!</code> or <code>!!</code>, and <code>|+</code>) hold ''content''—separate any attribute from its content with a single pipe (<code>|</code>), with attributes preceding content. *''Table'' and ''row'' marks (<code><nowiki>{|</nowiki></code> and <code>|-</code>) do not directly hold content. Do ''not'' add a pipe (<code><nowiki>|</nowiki></code>) after any attributes. Commonly included attributes with table scope include: <code>class</code>, for example <code>class="wikitable"</code>; or <code>style</code> for [[CSS]] styling. Other attributes have row- or column scope, e.g., <code>scope</code>, to indicate row or column header cells; <code>rowspan</code>, to extend cells by more than one row; and <code>colspan</code>, to extend cells by more than one column. == Wikicode syntax tutorial == <templatestyles src="Help:Table/styles.css" /> {{Main|Help:Basic table markup}} {{For|a history of the development of wikicode table syntax|Help:Table/History of pipe syntax development{{!}}/History of pipe syntax development}} A table may be created entirely in [[wikicode]] using special table markup [[/History of pipe syntax development|developed for the purpose]]. No knowledge of HTML is required. === Begin and end delimiters === Use <code>'''<nowiki>{|</nowiki>'''</code> to begin a table, and <code>'''|}'''</code> to end it. Each one needs to be on its own line: <syntaxhighlight lang=wikitext class=gridbox> {| table code goes here |} </syntaxhighlight> Optional parameters like {{kbd|class}} may be placed on the Begin-table delimiter line. See {{slink||Class}} below. === Caption === An optional '''table [[Help: Table caption|caption]]''' is included with a line starting with a vertical bar and plus sign "<code>'''|+'''</code>" and the caption after it: <syntaxhighlight lang=wikitext highlight=2 class=gridbox> {| |+ caption table code goes here |} </syntaxhighlight> === Row start === To start a new '''table [[Row (database)|row]]''', type a vertical bar and a [[hyphen]] on its own line: "<code>'''|-'''</code>". The codes for the cells in that row start on the next line. <syntaxhighlight lang=wikitext highlight=3,5 class=gridbox> {| |+ The table's caption |- row code goes here |- next row code goes here |} </syntaxhighlight> For details about rows, see {{slink||Row operations}} below. === Cells === Type the codes for each ''[[table cell]]'' in the next row, starting with a bar: <syntaxhighlight lang=wikitext highlight=4,6,7 class=gridbox> {| |+ The table's caption |- | cell code goes here |- | next row cell code goes here | next cell code goes here |} </syntaxhighlight> Cells can be separated with either a new line and a single bar, or by a double bar "<code>'''||'''</code>" on the same line. Both produce the same output: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" highlight=4> {| |+ The table's caption |- |Cell 1 || Cell 2 || Cell 3 |- |Cell A |Cell B |Cell C |- |Cell x |Cell y||Cell z |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| |+ The table's caption |- |Cell 1 || Cell 2 || Cell 3 |- |Cell A |Cell B |Cell C |- |Cell x |Cell y||Cell z |} </div> For details about table cells, see {{slink||Cell operations}} below. === Optional parameters === {{anchor|wikitable class}} 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 <code>wikitable</code> [[CSS]] class, which in Wikipedia's [[MediaWiki:Common.css|external style sheet]] is defined to apply a gray color scheme and cell borders to tables using it: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" highlight=1> {| class=wikitable |+ The table's caption ! Column header 1 ! Column header 2 ! Column header 3 |- ! Row header 1 | Cell 2 || Cell 3 |- ! Row header A | Cell B | Cell C |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |+ The table's caption ! Column header 1 ! Column header 2 ! Column header 3 |- ! Row header 1 | Cell 2 || Cell 3 |- ! Row header A | Cell B | Cell C |} </div> 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 {{tag|thead|o}}, {{tag|tbody|o}}, {{tag|tfoot|o}}, {{tag|colgroup|o}}, and {{tag|col|o}} elements are currently [[Help:HTML in wikitext#thead, tfoot, tbody|not supported in MediaWiki]], {{as of|lc=y|2021|12}}. 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 <nowiki><br></nowiki> in one of the cells. That is what is done here: * {{oldid2|1206274265|Sorting buttons in a separate row|2024 revision of {{delink|{{slink|Help:Sortable tables#Sorting buttons in a separate row}}}}}} {{t|sort under}} is simpler for putting the sorting arrows below the header text in order to narrow a table. With <code>colspan</code> and <code>rowspan</code> cells can span several columns or rows; {{see below|{{section link||Colspan and rowspan}}, below}} === Displaying a pipe character === Displaying a [[vertical bar|pipe]] character as part of the text of a table cell requires a workaround. See {{slink||Rendering the pipe}}. === Scope === '''Column headers''' are identified by <code>! scope="col" |</code> instead of <code>|</code>. '''Row headers''' are identified by <code>! scope="row" |</code> instead of <code>|</code>. Each header cell should be on a separate line in the wiki-markup. The <code>scope="col"</code> and <code>scope="row"</code> 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 [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Overview of basics|requires the use of scope for column and row headers]]. For [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Complex tables|complex tables]], when a header spans two columns or rows, use <code>! scope="colgroup" colspan="2" |</code> or <code>! scope="rowgroup" rowspan="2" |</code> 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 <code>id=</code> to set a unique value without spaces on each header, then reference the id(s) on the data cells that have unclear headers using <code>headers=</code> 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 "{{visible anchor|plainrowheaders}}" class which left-aligns the row headers and removes the bolding. Left-alignment of row headers only occurs if <code>class=wikitable</code> and <code>scope=row</code> are both used. <div class="box"> A typical example may be marked up like this: '''Wikitext''' <syntaxhighlight lang="wikitext" highlight="7,8,10,11"> {| class="wikitable plainrowheaders" |+ The table's caption ! scope=col | Column header 1 ! scope=col | Column header 2 ! scope=col | Column header 3 |- ! scope=row | Row header 1 | Cell 2 || Cell 3 |- ! scope=row | Row header A | Cell B || Cell C |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class="wikitable plainrowheaders" |+ The table's caption ! scope=col | Column header 1 ! scope=col | Column header 2 ! scope=col | Column header 3 |- ! scope=row | Row header 1 | Cell 2 || Cell 3 |- ! scope=row | Row header A | Cell B || Cell C |} </div> == Examples == === 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. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| |- | A | B |- | C | D |} </syntaxhighlight> <syntaxhighlight lang=wikitext highlight=3,5> {| |- | A || B |- | C || D |} </syntaxhighlight></div> <div class="box"> '''Produces (note that there are no borders).''' {| |- | A | B |- | C | D |} </div> === Multiplication table === Note that in this example <code>class="wikitable"</code> is used to style the table with Wikipedia's external style sheet for tables. It adds borders, background shading, and bold header text. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable style="text-align: center;" |+ Multiplication table |- ! × ! 1 ! 2 ! 3 |- ! 1 | 1 || 2 || 3 |- ! 2 | 2 || 4 || 6 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable style="text-align: center;" |+ Multiplication table |- ! × ! 1 ! 2 ! 3 |- ! 1 | 1 || 2 || 3 |- ! 2 | 2 || 4 || 6 |} </div> == Whole table operations == === Class === One or more classes may be added to the [[#Begin and end delimiters|§ Begin-table delimiter]] line at the top of the table, and may be used to supply predefined style to the table. The wikicode table {{kbd|class}} attribute [[Help:Basic table markup#How tables are formed|corresponds directly]] to the "{{kbd|class}}" [[HTML attribute|attribute of the HTML]] <code><table></code> element. To add multiple classes to a table, place them all on the same line, embedded in double quotes and separated by a space: <syntaxhighlight lang=wikitext class=grid> {| class="wikitable sortable collapsible" </syntaxhighlight> Some predefined classes are: {| class="wikitable sortable floatright" |+ A sortable wikitable |- ! breed ! ht ! wt |- | Labrador Retriever | 23 | 70 |- | French Bulldog | 12 | 25 |- | German Shepherd | 27 | 78 |- | Golden Retriever | 23 | 71 |- | English Bulldog | 14 | 45 |} * {{kbd|wikitable}} – provides column headers with bold font on shaded background, and other common style. See [[Help:Table/Advanced#Horizontal alignment in cells|here]] for details. This class should be used for almost all tables, unless there is a reason not to. * {{kbd|sortable}} – adds up & down icons to column headers which enable sorting the table on a given column. See [[Help:Sortable tables#Creating sortable tables|sortable tables]]. * {{kbd|mw-collapsible}} – See [[Help:Table/Advanced#Collapsible tables|collapsible tables]].{{efn|group=note|Collapsible tables: the class {{kbd|collapsible}} is available, but no longer recommended; use {{kbd|mw-collapsible}} instead. See [[Help:Table/Advanced#Collapsible tables|here]] for further details.}} * {{kbd|plainrowheaders}} – applies left-aligned and normal-weight formatting of row headers. See [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Layout of table headers|Table header layout]]. Must be placed after ''wikitable'' if they both appear in the class declaration. * {{kbd|floatright}} – same as applying <code><nowiki>style="float:right; clear:right; margin-left:8px"</nowiki></code> to the entire table * {{kbd|floatleft}} – same as applying <code><nowiki>style="float:left; clear:left; margin-right:8px"</nowiki></code> to the entire table Note: [[Template:Table]] may also be used to apply classes to the [[#Begin and end delimiters|§ Begin-table delimiter]] line. === Captions and summaries === {{More|Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Proper table captions and summaries}} Explicit table ''captions'' (or ''titles'') are recommended for data tables as a best practice; the Wikipedia Manual of Style [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Correct table captions|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 <code>|+</code> markup, similar to a table row (<code>|-</code>), 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. Many article editors dislike table captions when the table is directly below, or not far away from, a similar article heading. But [[screen reader]] users still need a table caption to quickly browse from table to table. In this case use the popular {{t|sro}} template: '''[[Template:Screen reader-only]].''' Add the template to the table caption, and then only screen reader users will see it. Example: :<syntaxhighlight lang="wikitext" inline>|+ {{sro|Table caption}}</syntaxhighlight> For current table caption and summary guidelines see the w3.org page: '''[https://www.w3.org/WAI/tutorials/tables/caption-summary Caption & Summary, in Tables Tutorial].''' [[Web Accessibility Initiative]] (WAI). The summary info in the paragraph below is out of date: A {{em|summary}} 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 <code>alt</code> description. A summary is added with <code>summary="{{var|Summary text here.}}"</code>, on the same line as the <code><nowiki>{|</nowiki></code> that opened the table, along with any <code>class=</code> and other parameters for the table as a whole. <!--{{em|The summary cannot be styled, wikilinked, or otherwise marked up, but must be simple, plain text. It cannot even include italics.}} (It may contain character entity codes, such as <code>&ndash;</code>.)--> '''The <code>summary=</code> attribute is, however, [[Wikipedia:HTML 5#Table_attributes|obsolete in HTML 5]].''' <div class="box" style="max-width:30em;"> '''Wiki markup''' example showing left-aligned caption with a source citation: <syntaxhighlight lang="wikitext"> {| class=wikitable |+ style="text-align: left;" | Data reported for 2014–2015, by region<ref name="Garcia 2005"/> |- ! scope=col | Year !! scope=col | Africa !! scope=col | Americas !! scope=col | Asia & Pacific !! scope=col | Europe |- ! scope=row | 2014 | 2,300 || 8,950 || ''9,325'' || 4,200 |- ! scope=row | 2015 | 2,725 || ''9,200'' || 8,850 || 4,775 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |+ style="text-align: left;" | Data reported for 2014–2015, by region{{dummy ref|99}} |- ! scope=col | Year !! scope=col | Africa !! scope=col | Americas !! scope=col | Asia & Pacific !! scope=col | Europe |- ! scope=row | 2014 | 2,300 || 8,950 || ''9,325'' || 4,200 |- ! scope=row | 2015 | 2,725 || ''9,200'' || 8,850 || 4,775 |} </div> === Colspan and rowspan === {{anchor|Cells spanning multiple rows or columns|Mélange|Merged cells|Colspan and rowspan}} It is possible to create cells that stretch over two or more columns. For this, one uses <code>|colspan={{var|n}} | {{var|content}}</code>. Similarly, one can create cells that stretch over two or more rows. This requires <code>|rowspan={{var|m}} | {{var|content}}</code>. In the table code, one must {{em|leave out the cells that are covered by such a span}}. The resulting column- and row-counting must fit. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext line highlight=8,19> {| class=wikitable style="text-align: center;" !col1 !col2 !col3 !col4 |- !row1 | colspan=2 | A <!-- column counting: cell 'B' can not exist --> |C |- !row2 |AA |BB |CC |- !row3 |AAA | rowspan=2 | BBB |CCC |- !row4 |AAAA <!-- row counting: cell 'BBBB' can not exist --> |CCCC |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable style="text-align: center;" !col1 !col2 !col3 !col4 |- !row1 | colspan=2 | A <!-- column counting: cell 'B' can not exist --> |C |- !row2 |AA |BB |CC |- !row3 |AAA | rowspan=2 | BBB |CCC |- !row4 |AAAA <!-- row counting: cell 'BBBB' can not exist --> |CCCC |} </div> In the code, the cell <code>| colspan="2" | A</code> spans two columns. Note that, in the next column, {{em|a cell expected to contain "B" does not exist}}. Similar: in the code, cell <code>| rowspan="2" | BBB</code> spans two rows. {{em|A cell expected to contain "BBBB" does not exist}}. <div class="box" style="max-width:30em;"> '''Wikitext''' <syntaxhighlight lang=wikitext line highlight=14> {| class=wikitable |- ! Column 1 !! Column 2 !! Column 3 |- | rowspan=2 | A | colspan=2 style="text-align: center;" | B <!-- column 3 of this row occupied by cell B (which is to the left) --> |- <!-- column 1 of this row occupied by cell A (above) --> | C | D |- | E | rowspan=2 colspan=2 style="text-align: center;" | F <!-- column 3 of this row occupied by cell F (to the left) --> |- | G <!-- columns 2 and 3 of this row occupied by cell F (above) --> |- | colspan=3 style="text-align: center;" | H <!-- columns 2 and 3 of this row occupied by cell H (to the left) --> |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- ! Column 1 !! Column 2 !! Column 3 |- | rowspan=2 | A | colspan=2 style="text-align: center;" | B |- | C <!-- column 1 occupied by cell A --> | D |- | E | rowspan=2 colspan=2 style="text-align: center;" | F |- | G <!-- columns 2 and 3 of this row occupied by cell F --> |- | colspan=3 style="text-align: center;" | H |} </div> Note that using <code>rowspan=2</code> for cell '''G''' combined with <code>rowspan=3</code> 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 <code>rowspan</code> and <code>colspan</code> are also shown. <div class="box" style="max-width:30em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- ! Column 1<br>(row 1 cell 1) !! Column 2<br>(row 1 cell 2) !! Column 3<br>(row 1 cell 3) |- | rowspan=2 | A<br>(row 2 cell 1)<br><code>rowspan=2</code> | colspan=2 style="text-align: center;" | B<br>(row 2 cell 2)<br><code>colspan=2</code> |- | C<br>(row 3 cell 1) <!-- column 1 occupied by cell A --> | D<br>(row 3 cell 2) |- | E<br>(row 4 cell 1) | rowspan=2 colspan=2 style="text-align: center;" |F<br>(row 4 cell 2)<br><code>rowspan=2 colspan=2</code> |- | G<br>(row 5 cell 1) <!-- column 2+3 occupied by cell F --> |- | colspan=3 style="text-align: center;" | H<br>(row 6 cell 1)<br><code>colspan=3</code> |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- ! Column 1<br>(row 1 cell 1) !! Column 2<br>(row 1 cell 2) !! Column 3<br>(row 1 cell 3) |- | rowspan=2 | A<br>(row 2 cell 1)<br><code>rowspan=2</code> | colspan=2 style="text-align: center;" | B<br>(row 2 cell 2)<br><code>colspan=2</code> |- | C<br>(row 3 cell 1) <!-- column 1 occupied by cell A --> | D<br>(row 3 cell 2) |- | E<br>(row 4 cell 1) | rowspan=2 colspan=2 style="text-align: center;" |F<br>(row 4 cell 2)<br><code>rowspan=2 colspan=2</code> |- | G<br>(row 5 cell 1) <!-- column 2+3 occupied by cell F --> |- | colspan=3 style="text-align: center;" | H<br>(row 6 cell 1)<br><code>colspan=3</code> |} </div> 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. == Table style == A {{kbd|style}} element may be added to apply to the entire table, to all the cells [[#Row style|§ in a row]], or just to individual cells in the table. Adding a style to a column requires a template such as {{tl|table alignment}} (for horizontal alignment of text). To add style to the entire table, add the {{kbd|style}} element to the [[#Begin and end delimiters|§ Begin-table delimiter]] line at the top of the table. Note that in some cases, it may be better to use the style encapsulated in one of the predefined classes; see {{slink||Class}}. === Horizontal text alignment === {{More|Help:Table/Advanced#Horizontal alignment in cells}} Text alignment (right/center/left) for the whole table (except the headers in a table using <code>class=wikitable</code>) can be done at the top line of the table wikitext: <syntaxhighlight lang=wikitext highlight=1 class=gridbox> {| class=wikitable style=text-align:right; ... |} </syntaxhighlight> Text alignment for a column can be done with {{tl|table alignment}}. === Height === The height of the whole table can be specified using standard CSS style properties on the [[#Wikicode syntax tutorial|§ start table indicator]] line: <syntaxhighlight lang=wikitext highlight=1,6 class=gridbox> {| class=wikitable style=height:14em; . . . |} </syntaxhighlight> Note that you may also specify the [[#Row style|§ height of individual rows]], and if they add up to more than the table height you specified or if word wrapping increases row height, the table height you specified will be ignored and the table height increased as needed to accommodate all the rows (except on mobile where the bottom of the table will be cut off). === Borders === '''''Note:''' [[Wikipedia:HTML 5#Table attributes]]. CSS to replace obsolete attributes for borders, padding, spacing, etc.'' Add a border around a table using the CSS property <code>border: ''thickness style color'';</code>, for example <code>border:3px dashed red</code>. This example uses a solid (non-dashed) gray border that is one pixel wide: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| style="border-spacing: 2px; border: 1px solid darkgray;" ! style="width: 140px;" | Left ! style="width: 150px;" | Center ! style="width: 130px;" | Right |- | [[File:Starred.svg |120px| center]] | [[File:Star full.svg |120px| center]] | [[File:Stargreen.svg |120px| center]] |- style="text-align: center;" |Red star || Orange star || Green star |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| style="border-spacing: 2px; border: 1px solid darkgray;" ! style="width: 140px;" | Left ! style="width: 150px;" | Center ! style="width: 130px;" | Right |- | [[File:Starred.svg |120px| center]] | [[File:Star full.svg |120px| center]] | [[File:Stargreen.svg |120px| center]] |- style="text-align: center;" |Red star || Orange star || Green star |} </div> Note the bottom-row texts are centered by <code>style="text-align: center;"</code> to match the centering of the stars in their cells. As long as the <code>File:</code> specs omit the parameter <code>|thumb</code> they don't show the caption lines in the table (only during mouse-over). The border color <code>darkgray</code> matches typical tables or infoboxes in articles; however, it could be any color name (as in <code>style="border: 1px solid darkgreen;"</code>) or use a [[Hex triplet|hex-color]] (such as: <code>#DDCCBB</code>). === Border-collapse: conflicting or double borders === <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| border=1 |- | A || B || C |- | D || E || F |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| border=1 |- | A || B || C |- | D || E || F |} </div> If all cells have the same border color, the resulting double borders may not be wanted; add the <code>border-collapse: collapse;</code> CSS property on the table opening tag to reduce them to single ones (<code>cellspacing=...</code> is [[WP:HTML5|obsolete]]). Additionally, the [[W3C]] [http://www.w3.org/TR/html5/obsolete.html#attr-background allows] the use of the otherwise obsolete <code>border=</code> attribute on the table root (<code><nowiki>{|</nowiki></code>) 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 <code>border-collapse</code> property to combine the double borders, as described above: <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| border=1 style="border-collapse: collapse;" |- | A || B || C |- | D || E || F |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| border=1 style="border-collapse: collapse;" |- | A || B || C |- | D || E || F |} </div> === Float table left or right === Two table classes <code>floatleft</code> and <code>floatright</code> (case sensitive) help floating the table and adjusting table margins so that they do not stick to the text. <code>floatleft</code> floats the table to the left and adjusts right margin. <code>floatright</code> does the opposite. Example: <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=3,13> This paragraph is before the table. [[File:Starred.svg |120px|right]] {| class="wikitable floatleft" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |} {| class="wikitable floatright" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |} ... Lorem text after table </syntaxhighlight> </div> '''As it appears in a browser:''' This paragraph is before the table. [[File:Starred.svg |120px|right]] {| class="wikitable floatleft" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |} {| class="wikitable floatright" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |} {{lorem ipsum span|9}} Alternatively, you can use '''CSS to get the same result:'''<br> '''<nowiki>{| class="wikitable" style="float:left; clear:left; margin-right:8px;"</nowiki>'''<br> '''<nowiki>{| class="wikitable" style="float:right; clear:right; margin-left:8px;"</nowiki>''' This paragraph is before the table. [[File:Starred.svg |120px|right]] {| class="wikitable" style="float:left; clear:left; margin-right:8px;" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |} {| class="wikitable" style="float:right; clear:right; margin-left:8px;" |+ Caption text |- ! Header A !! Header B !! Header C |- | row 1 A || row 1 B || row 1 C |- | row 2 A || row 2 B || row 2 C |} {{lorem ipsum span|9}} === Centering tables === {{shortcut|HELP:TABLECENTER}} To center a table horizontally, use style {{kbd|margin: auto}}, which applies to the left and right margins. Text does not flow around centered tables as it does for floated tables; that is, no text appears to either side: <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=2> Text before table... {| class="wikitable" style="margin: auto; border: none;" |+ Centered table |- ! scope="col" | Duis ! scope="col" | aute ! scope="col" | irure |- | dolor || in reprehenderit || in voluptate velit |- | esse cillum dolore || eu fugiat nulla || pariatur. |} ...text after table </syntaxhighlight> </div> '''As it appears in a browser:''' Text before table... {| class="wikitable" style="margin: auto; border: none;" |+ Centered table |- ! scope="col" | Duis ! scope="col" | aute ! scope="col" | irure |- | dolor || in reprehenderit || in voluptate velit |- | esse cillum dolore || eu fugiat nulla || pariatur. |} ...text after table. Style {{kbd|margin:auto}} may be combined with top and bottom margin in the standard way for CSS, e.g. <syntaxhighlight lang=wikitext inline>style="margin:1em auto"</syntaxhighlight> defines top and bottom margins of 1em, and automatic (centered) left and right margins. '''Tip:''' For Android Chrome, use: :<code><nowiki>{| style="margin: auto; border: none;"</nowiki></code>{{efn|group=note|''border: none;'' to avoid an empty column in tables narrower than the browser window in Android Chrome.}} '''Note:''' <code>align="center"</code> is [[Wikipedia:HTML 5|deprecated in HTML5]], and does not work well in Mediawiki software. For example; it will not override the left alignment of tables via <code>class=wikitable</code>. === Static ('sticky') headers=== Headers can be frozen so they're always at the top (or left) as one scrolls through a large table. See {{tl|Sticky header}} and {{tl|Sticky table start}}. === Nested tables === {{hatnote|Note: because they cause [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Avoiding nested data tables|accessibility issues]], header cells in nested tables should be avoided whenever possible. For accessibility, any complicated table must be carefully designed to maintain normal flow, i.e. the ordering of content in the page code should match the order in which it is to be presented.}} 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, <code>rowspan</code> and <code>colspan</code> may be used, but again it is sometimes simpler and more maintainable to use nested tables. {{em|Nested tables must start on a new line.}} 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. <code>float</code> 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. <div class="box" style="background-color: white;"> {| style="border: 1px solid black;" | style="border: 1px solid black;" | α | style="border: 1px solid black; text-align:center;" | cell2 {| style="border: 2px solid black; background: #ffffcc;" <!-- The nested table must be on a new line --> | style="border: 2px solid darkgray;" | NESTED |- | style="border: 2px solid darkgray;" | TABLE |} | style="border: 1px solid black; vertical-align: bottom;" | the original table again | style="border: 1px solid black; width:100px" | {| style="border: 2px solid black; background: #ffffcc" | style="border: 2px solid darkgray;" | A |} {| style="border: 2px solid black; background: #ffffcc" | style="border: 2px solid darkgray;" | B | style="border: 2px solid darkgray;" | B |} | style="border: 1px solid black; width: 50px" | {| style="border: 2px solid black; background:#ffffcc; float:left" | style="border: 2px solid darkgray;" | C |} {| style="border: 2px solid black; background:#ffffcc; float:right" | style="border: 2px solid darkgray;" | D |} |} </div> <div class="box"> '''Wikitext:''' <syntaxhighlight lang=wikitext line highlight="4-8,11-17,19-24"> {| style="border: 1px solid black;" | style="border: 1px solid black;" | α | style="border: 1px solid black; text-align:center;" | cell2 {| style="border: 2px solid black; background: #ffffcc;" <!-- The nested table must be on a new line --> | style="border: 2px solid darkgray;" | NESTED |- | style="border: 2px solid darkgray;" | TABLE |} | style="border: 1px solid black; vertical-align: bottom;" | the original table again | style="border: 1px solid black; width:100px" | {| style="border: 2px solid black; background: #ffffcc" | style="border: 2px solid darkgray;" | A |} {| style="border: 2px solid black; background: #ffffcc" | style="border: 2px solid darkgray;" | B | style="border: 2px solid darkgray;" | B |} | style="border: 1px solid black; width: 50px" | {| style="border: 2px solid black; background:#ffffcc; float:left" | style="border: 2px solid darkgray;" | C |} {| style="border: 2px solid black; background:#ffffcc; float:right" | style="border: 2px solid darkgray;" | D |} |} </syntaxhighlight></div> == Width == {{See also|Help:Table/Width}} '''''Note:''' <code>width=X</code> is obsolete in [[HTML 5]], and so it could eventually be ignored by [[MediaWiki]]. See: [[Wikipedia: HTML 5#Table attributes]]. Use CSS styles or line breaks (<code><nowiki><br></nowiki></code>) instead.'' === Vertical 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 '''{{tl|vertical header}}''' template. For example: <syntaxhighlight lang="wikitext"> ! {{vertical header|Date/Page}} </syntaxhighlight> If the text includes an equals sign then replace it with <code><nowiki>{{=}}</nowiki></code>. {| class="wikitable" style="text-align: center;" |+ Rotated column headers using {{tlx|vertical header}} |- ! {{vertical header|Date/Page}} ! {{vertical header|[[Wikipedia:WikiProject Video games|VG: Project]]}} ! {{vertical header|[[Wikipedia talk:WikiProject Video games|VG: Talk]]}} ! {{vertical header|[[Portal:Video games|VG: Portal]]}} ! {{vertical header|[[Wikipedia:WikiProject Video games/Article guidelines|VG: Article guidelines]]}} ! {{vertical header|[[Wikipedia:WikiProject Video games/Templates|VG: Templates]]}} ! {{vertical header|[[Wikipedia:WikiProject Video games/Sources|VG: Sources]]}} ! {{vertical header|[[Wikipedia:WikiProject Video games/Assessment|VG: Assessment]]}} ! {{vertical header|[[Wikipedia:WikiProject Video games/Cleanup|VG: Cleanup]]}} ! {{vertical header|[[Wikipedia:WikiProject Video games/Requests|VG Requests]]}} |- ! 05/08 | 4266 || 7828 || 7282 || 1105 || 224 || 161 || 916 || 506 || 231 |- ! 04/08 | 4127 || 6190 || 6487 || 1139 || 241 || 205 || 1165 || 478 || 301 |} If you want to use '''[[Template:Sticky table start|sticky headers]]''' with vertical headers it is important to make the sticky header less tall for cell phone use. '''{{t|abbr}}''' is one way. Also by moving some info to the table caption. See example with various methods at '''{{tl|vertical header}}.''' === Line breaks in headers === An editor who is blind says line breaks '''<code><nowiki><br></nowiki></code>''' are fine in this discussion '''[[Help talk:Table/Advanced#Line breaks in table cells|here]]'''. If it is just two words in the column header, then a line break is simplest. Or if you want three words on separate lines in the header. But for longer header text, max-width is sometimes better, because when the viewport is narrow enough the browser may narrow the header to be less than the max-width setting. The browser often does this better than what line breaks allow in a narrow viewport. === Max-width === Narrowing columns with '''max-width''' style is fine; such as <code>style="max-width:Xpx;"</code> or <code>style="max-width:Xem;"</code> or [https://www.w3schools.com/cssref/css_units.php other CSS units]. The number by itself without units defaults to pixels. See width examples on this '''[[Help:Table/Width|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 strict widths (<code>style="width:Xpx;"</code> or <code>style="width:Xem;"</code>) 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, portrait view, landscape view, 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 sometimes 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. '''<code>style=max-width:Xem</code>''' can be used in table headers. The following table excerpt is adapted from [https://en.wikipedia.org/w/index.php?title=List_of_countries_by_wealth_per_adult&oldid=1023784152 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 '''<code>style=max-width:Xem</code>''' was used in selected column heads. '''[[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: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=6-8> {{static row numbers}}{{sticky header}}{{table alignment}} {|class="wikitable sortable static-row-numbers sticky-header col1left" style=text-align:right |+ Median and mean wealth per adult ([[USD]]) by country |- ! Location ! style=max-width:4em | Median wealth ! style=max-width:4em | Mean wealth ... </syntaxhighlight></div> <div class="box"> '''Produces''' {{static row numbers}}{{sticky header}}{{table alignment}} {|class="wikitable sortable static-row-numbers sticky-header col1left" style=text-align:right |+ Median and mean wealth per adult ([[USD]]) by country |- ! Location ! style=max-width:4em | Median wealth ! style=max-width:4em | Mean wealth |- |{{DRC}} |382 |1,084 |- |{{MOZ}} |352 |880 |} </div> '''{{t|sort under}}''' narrows the table columns further: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {{static row numbers}}{{sticky header}}{{sort under}}{{table alignment}} {|class="wikitable sortable static-row-numbers sticky-header sort-under col1left" style=text-align:right </syntaxhighlight> </div> <div class="box"> '''Produces''' {{static row numbers}}{{sticky header}}{{sort under}}{{table alignment}} {|class="wikitable sortable static-row-numbers sticky-header sort-under col1left" style=text-align:right |+ Median and mean wealth per adult ([[USD]]) by country |- ! Location ! style=max-width:4em | Median wealth ! style=max-width:4em | Mean wealth |- |{{DRC}} |382 |1,084 |- |{{MOZ}} |352 |880 |} </div> If using '''{{t|sticky header}}''', then for cell phones even narrower headers are better: {{static row numbers}}{{sticky header}}{{table alignment}}{{sort under}} {|class="wikitable sortable static-row-numbers sticky-header col1left sort-under" style=text-align:right |+ [[Median]] and [[mean]] wealth per adult ([[USD]]) by country |- ! Location ! Median ! Mean |- |{{DRC}} |382 |1,084 |- |{{MOZ}} |352 |880 |} Here below is what the table looks like without '''<code>style=max-width:Xem</code>''' and without a '''caption'''.<br> 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. {{static row numbers}}{{sticky header}}{{table alignment}} {|class="wikitable sortable static-row-numbers sticky-header col1left" style=text-align:right |- ! Location ! Median wealth per adult ([[USD]]) ! Mean wealth per adult ([[USD]]) |- |{{DRC}} |382 |1,084 |- |{{MOZ}} |352 |880 |} === Other width methods === {{hatnote|'''Note:''' Fixed widths are not recommended for tables. Max-width is better. See previous section}} 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 [[Word wrap|wrap-around of text]] is forced for columns where the width requires it. Do not use <code>min-width:Xpx;</code> <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- ! scope="col" style="width: 50px;" | Name ! scope="col" style="width: 250px;" | Effect ! scope="col" style="width: 350px;" | Games found in |- | Poké Ball || Regular Poké Ball || All versions |- | Great Ball || Better than a Poké Ball || All versions |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- ! scope="col" style="width: 50px;" | Name ! scope="col" style="width: 250px;" | Effect ! scope="col" style="width: 350px;" | Games found in |- |Poké Ball || Regular Poké Ball || All versions |- |Great Ball || Better than a Poké Ball || All versions |} </div> To set column widths in a table without headers, specify the width in the first cell for each column. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- | style="width: 100pt;" | This column is 100 points wide | style="width: 200pt;" | This column is 200 points wide | style="width: 250pt;" | This column is 250 points wide |- | blah || blih || bluh |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | style="width: 100pt;" | This column is 100 points wide | style="width: 200pt;" | This column is 200 points wide | style="width: 250pt;" | This column is 250 points wide |- | blah || blih || bluh |} </div> You can also use percentages, such as <code>style="width: 50%;"</code> 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. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 225px;" | Capital |- | Netherlands || Amsterdam |} {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 225px;" | Capital |- | France || Paris |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 250px;" | Capital |- | Netherlands || Amsterdam |} {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 250px;" | Capital |- | France || Paris |} </div> === Nowrap === A column will be as wide as its widest cell. To keep a cell from wrapping use <code>style="white-space: nowrap;"</code> If the cell is too wide though this may not be a good idea in cell phones. Part of the table may extend past the screen (especially in portrait view). Without <code>nowrap</code>, as it appears in a browser: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {|class="wikitable sortable" |- ! scope=col | Episode ! scope=col | Date ! scope=col | Summary |- |"The Journey Begins" |January 1, 2010 |{{lorem ipsum|1}}... <!-- produces the long text --> |} </syntaxhighlight></div> <div class="box"> '''Produces''' {|class="wikitable sortable" |- ! scope=col | Episode ! scope=col | Date ! scope=col | Summary |- |"The Journey Begins" |January 1, 2010 |{{lorem ipsum|1}} |} </div> With <code>nowrap</code>, on both the Episode and Date columns, as it appears in a browser: <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=7,8> {|class="wikitable sortable" |- ! scope=col | Episode ! scope=col | Date ! scope=col | Summary |- | style="white-space: nowrap;" |"The Journey Begins" | style="white-space: nowrap;" |January 1, 2010 |{{lorem ipsum|1}}... <!-- produces the long text --> |} </syntaxhighlight></div> <div class="box"> '''Produces''' {|class="wikitable sortable" |- ! scope=col | Episode ! scope=col | Date ! scope=col | Summary |- | style="white-space: nowrap;" |"The Journey Begins" | style="white-space: nowrap;" |January 1, 2010 |{{lorem ipsum|1}} |} </div> == Row operations == Table rows are added after the [[#Wikicode syntax tutorial|§ table start indicator]], and after any optional [[#Whole table operations|§ whole table markup]] such as a caption, table summary, or [[#Setting column widths. Other methods|§ column scope]] attributes. === Starting a new row === To start a new '''table [[Row (database)|row]]''', type a vertical bar and a [[hyphen]] on its own line: "<code>'''|-'''</code>". The codes for the cells in that row start on the next line. An <code>id</code> for [[#Link directly to a row|§ anchoring in-links]], and [[#Row style|§ row style]] may be included on the same line. <syntaxhighlight lang=wikitext class=gridbox> {| |+ The table's caption |- row styling goes here row code goes here |} </syntaxhighlight> === Row style === {{Further|#Height|#Setting borders}} Row style (height, width, borders, text alignment, background color, bolding, italics, etc.) may be added to a wikitable row by appending [[CSS#Properties|CSS style properties]] to the row start line after the <code>'''|-'''</code> indicator. Here is an example increasing the height of the middle row. The top row has italic text. The last row has bold text and a yellow background: <div class=box> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=4,6,8> {| class=wikitable |- ! Left !! Center !! Right |- style=font-style:italic; | Top left || Top center || Top right |- style=height:9em; id=mid | Middle left || Middle center || Middle right |- style="font-weight:bold; background-color:yellow;" | Bottom left || Bottom center || Bottom right |} </syntaxhighlight></div> <div class=box> '''Produces''' {| class=wikitable |- ! Left !! Center !! Right |- style=font-style:italic; | Top left || Top center || Top right |- style=height:9em; id=mid | Middle left || Middle center || Middle right |- style="font-weight:bold; background-color:yellow;" | Bottom left || Bottom center || Bottom right |} </div> Note that the row also contains an <code>id</code> attribute; this will be explained later in the section about [[#Link directly to a row|linking directly to a row]]. === Row headers === Note that with row headers you need to use a separate row in the wikitext for the row header cell. Here below is what a table 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. <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" highlight=5,7> {| class=wikitable |+ The table's caption ! Column 1 !!Column 2 !!Column 3 |- ! Row header 1 || Cell 2 || Cell 3 |- ! Row header A || Cell B || Cell C |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |+ The table's caption ! Column 1 !!Column 2 !!Column 3 |- ! Row header 1 || Cell 2 || Cell 3 |- ! Row header A || Cell B || Cell C |} </div> Here is the table with a '''separate wikitext row for each row header cell.''' The data cells have plain unbolded text, and a lighter background. <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" highlight=5,8> {| class=wikitable |+ The table's caption ! Column 1 !!Column 2 !!Column 3 |- ! Row header 1 | Cell 2 || Cell 3 |- ! Row header A | Cell B || Cell C |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |+ The table's caption ! Column 1 !!Column 2 !!Column 3 |- ! Row header 1 | Cell 2 || Cell 3 |- ! Row header A | Cell B || Cell C |} </div> === Row numbers === Table rows may be numbered with the assistance of templates provided for the purpose. See [[Help:Sortable tables]] sections on row numbers, and these templates: * {{tl|Static row numbers}} * {{tl|Row numbers}} === Link directly to a row === {{sh|WP:ROWLINK|WP:LINKROW|Help:ROWANCHOR}} You can link directly to a row in a wikicode table, by including an <code>id</code> attribute on the line with the [[#Markup|§ row start]] indicator whose value is the [[WP:ANCHOR|anchor]] for the link. For example, you could code: :<code><nowiki>|- id="mid"</nowiki></code> and then link to it using <code><nowiki>The [[#mid|middle row]] is the tallest one.</nowiki></code> which produces: : The [[#mid|middle row]] is the tallest one. ''(Click to try it out!){{hairspace}}'' === Row template === {{For|adding a dynamic row number as a table column|#Row numbers}} 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.: * the basic code for a table row * code for color, alignment, and sorting mode * fixed texts such as units * special formats for sorting 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: * 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 <code>display: none;</code> for the purpose of having one format for [[Help:Sortable tables|sorting]] and another for display * easy specification of a format for a whole column, such as color and alignment Example: Using {{tlx|Help:Table/example row template}} <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" style="display: inline-block;"> {| class="wikitable sortable" |- ! scope=col | a ! scope=col | b ! scope=col | a/b {{Help:Table/example row template| 50|200}} {{Help:Table/example row template| 8| 11}} {{Help:Table/example row template|1000| 81}} |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class="wikitable sortable" |- ! scope=col | a ! scope=col | b ! scope=col | a/b {{Help:Table/example row template| 50|200}} {{Help:Table/example row template| 8| 11}} {{Help:Table/example row template|1000| 81}} |} </div> === Conditional table row === {{main|Wikipedia:Conditional tables}} For a conditional row in a table, we can have: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" style="display: inline-block;"> {| class=wikitable {{ #if:1|{{!}}- ! scope=row {{!}} row one, column one {{!}}row one, column two}} {{ #if: |{{!}}- ! scope=row {{!}} row two, column one {{!}}row two, column two}} |- ! scope=row {{!}} row three, column one | row three, column two |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable <!-- Row one is shown because the '1' evaluates to TRUE --> {{ #if:1|{{!}}- ! scope=row {{!}} row one, column one <!-- {{!}}'s get evaluated to the pipe character '|', i.e. template:! just contains '|' --> {{!}}row one, column two}} <!-- Row two NOT shown because the space between the ':' and the '|' evaluates to FALSE --> {{ #if: |{{!}}- ! scope=row {{!}} row two, column one {{!}}row two, column two}} <!-- Row three is shown --> |- ! scope=row {{!}} row three, column one | row three, column two |} </div> With comments to explain how it works, where note how the second row is missing: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" style="display: inline-block;"> {| class=wikitable <!-- Row one is shown because the '1' evaluates to TRUE. --> {{ #if:1|{{!}}- ! scope=row {{!}} row one, column one <!-- Any {{!}}'s are evaluated to the pipe character '|' since the template '!' just contains '|'. --> {{!}}row one, column two}} <!-- Row two is NOT shown because the space between the ':' and the '|' evaluates to FALSE. --> {{ #if: |{{!}}- ! scope=row {{!}} row two, column one {{!}}row two, column two}} <!-- Row three is shown. --> |- ! scope=row {{!}} row three, column one | row three, column two |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable <!-- Row one is shown because the '1' evaluates to TRUE --> {{ #if:1|{{!}}- ! scope=row {{!}} row one, column one <!-- {{!}}'s get evaluated to the pipe character '|', i.e. template:! just contains '|' --> {{!}}row one, column two}} <!-- Row two NOT shown because the space between the ':' and the '|' evaluates to FALSE --> {{ #if: |{{!}}- ! scope=row {{!}} row two, column one {{!}}row two, column two}} <!-- Row three is shown --> |- ! scope=row {{!}} row three, column one | row three, column two |} </div> == Cell operations == === Setting cell parameters === At the start of a cell, add your parameter followed by a single pipe. For example, <code>style="width: 300px;"|</code> sets that cell to a width of 300 pixels. To set more than one parameter, leave a space between each one. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| style="color: white;" |- | style="background-color: red;"|cell1 | style="width: 300px; background: blue;"|cell2 | style="background-color: green;"|cell3 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| style="color:white" |- | style="background-color: red;"|cell1 || style="width: 300px; background: blue;"|cell2 | style="background-color: green;"|cell3 |} </div> === Vertical alignment in cells === {{See also|Help:Table/Advanced#Horizontal alignment in cells}} '''''Note:''' The <code>valign=...</code> attribute is [[WP:HTML5|deprecated]] and MediaWiki may stop using it. See: [[Help:HTML in wikitext#Tables]].''<br> '''''Note:''' Use {{t|Vertical align rows}} to align all rows at once.'' By default, text is aligned to the vertical middle of the cell (2nd column in table below). [[CSS]] can be used to vertically align individual cells, or single rows. <div class="box-aligned"> {| class=wikitable |+ Demo of vertical alignment of individual cells |- |Three<br>lines<br>of{{nbsp}}text |No alignment |style=vertical-align:top |Top-aligned |style="vertical-align:middle |Middle-aligned |style="vertical-align:bottom |Bottom-aligned |} </div> <div class="box"> '''Relevant wikitext:''' <syntaxhighlight lang=wikitext highlight=1-3> |style=vertical-align:top |Top-aligned |style=vertical-align:middle |Middle-aligned |style=vertical-align:bottom |Bottom-aligned </syntaxhighlight></div> The example below illustrates the need for top alignment of a row. {| class=wikitable style=width:400px |- ! scope=row style=width:10% | Row header | style=width:70% |A longer piece of text. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<br><span style="color: #13a;">Imagine someone scrolling down the page, seeing the tops of "empty" columns, and wondering why they're empty.</span> | style=width:20% |Short text |} To align the text to the top of each cell in the row, apply the <code>style="vertical-align: top;"</code> CSS to the row. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=2> {| class=wikitable style=width:400px |- style=vertical-align:top ! scope=row style=width:10% | Row header | style=width:70% |A longer piece ... | style=width:20% |Short text |} </syntaxhighlight> </div> <div class="box"> '''Produces''' {| class=wikitable style=width:400px; |- style=vertical-align:top ! scope=row style=width:10% | Row header | style=width:70% |A longer piece of text. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.<br><span style="color: #13a;">Imagine someone scrolling down the page, seeing the tops of "empty" columns, and wondering why they're empty.</span> | style=width:20% |Short text |} </div> Documentation and more options for the CSS <code>vertical-align</code> property is [https://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align here]. === 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 third row the text is aligned to the right. See the following examples. <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {| class=wikitable |- | Cell content that is not indented or padded |- | style="padding-left: 2em;" | <code>style="padding-left: 2em;"</code> |- | style="text-align:right; padding-right: 2em;" | <code>style="text-align:right; padding-right: 2em;"</code> |- | style="padding-top: 2em;" | <code>style="padding-top: 2em;"</code> |- | style="padding-bottom: 2em;" | <code>style="padding-bottom: 2em;"</code> |- | style="padding: 3em 5%;" | <code>style="padding: 3em 5%;"</code> {{space|4}} (Top and Bottom: 3em. Left and Right: 5%) |- | style="padding: 3em 4em 5%;" | <code>style="padding: 3em 4em 5%;"</code> {{space|4}} (Top: 3em. Left and Right: 4em. Bottom: 5%) |- | style="padding: 3%;" | <code>style="padding: 3%;"</code> {{space|4}} (Top, Right, Bottom, and Left: all 3%) |- | style="padding: 1em 20px 8% 9em;" | <code>style="padding: 1em 20px 8% 9em;"</code> {{space|4}} (Top: 1em. Right: 20px. Bottom: 8%. and Left: 9em.) |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | Cell content that is not indented or padded |- | style="padding-left: 2em;" | <code>style="padding-left: 2em;"</code> |- | style="text-align:right; padding-right: 2em;" | <code>style="text-align:right; padding-right: 2em;"</code> |- | style="padding-top: 2em;" | <code>style="padding-top: 2em;"</code> |- | style="padding-bottom: 2em;" | <code>style="padding-bottom: 2em;"</code> |- | style="padding: 3em 5%;" | <code>style="padding: 3em 5%;"</code> {{space|4}} (Top and Bottom: 3em. Left and Right: 5%) |- | style="padding: 3em 4em 5%;" | <code>style="padding: 3em 4em 5%;"</code> {{space|4}} (Top: 3em. Left and Right: 4em. Bottom: 5%) |- | style="padding: 3%;" | <code>style="padding: 3%;"</code> {{space|4}} (Top, Right, Bottom, and Left: all 3%) |- | style="padding: 1em 20px 8% 9em;" | <code>style="padding: 1em 20px 8% 9em;"</code> {{space|4}} (Top: 1em. Right: 20px. Bottom: 8%. and Left: 9em.) |} </div> {{clear}} {{anchor|Pattern for arguments involving four sides|Clock order}} [[File:Westclox Big Ben.jpg|frameless|right|upright=0.55]] '''Pattern for arguments:''' The arguments to <code>style="padding: "</code> 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 [[12-hour clock|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 → right → bottom → left (see this<ref group=note>In <code>style="padding: 3em 4em 5%;"</code>, the value <code>4em</code> is used for both the "left" padding and the "right" padding, so the order going clockwise is: top (3em) → right [and hence also left] (4em) → bottom (5%); there is no "→ left" in this case because the "left" padding has already been defined. In <code>style="padding: 3em 5%;"</code>, the value <code>3em</code> is used for both the "top" and "bottom" padding while the value <code>5%</code> is used for both the "left" and "right" padding, so the order going clockwise is: top [and hence also bottom] (3em) → right [and hence also left] (5%); there is no "→ bottom" nor is there "→ left" in this case because the "bottom" and "left" padding have already been defined. The same reasoning also applies to <code>style="padding: 1em 20px 8% 9em;"</code>, and <code>style="padding: 3%;"</code>.</ref> footnote for an example with an explanation). This same order is also used elsewhere, such as when specifying [[#Individual cell borders|§ cell borders]] with <code>border-style: </code>. '''Setting default cell padding''' Use <code>cellpadding=</code> to set the default padding for each cell in a table. If <code>class=wikitable</code> is used then <code>cellpadding</code> is ignored. The default space between cells can be changed using <code>cellspacing=</code>. If <code>cellpadding</code> is not used <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {| style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </div> {{clear}} Using <code>cellpadding=10</code>: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {| cellpadding=10; style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| cellpadding=10; style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </div> Using <code>cellpadding=0</code>: <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| cellpadding=0; style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| cellpadding=0; style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </div> Using <code>cellpadding=0</code> and <code>cellspacing=0</code>: <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| cellpadding=0; cellspacing=0; style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| cellpadding=0; cellspacing=0; style="border:1px solid black" |- | Cell || Cell |- | Cell || Cell |} </div> === Individual cell borders === The same [[#Borders|§ CSS used for tables]] can be used in a cell's format specifier (enclosed in <code>|</code>...<code>|</code>) to put a border around each cell: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext highlight=6,8,10> {| style="border-spacing: 2px; border: 1px solid darkgray;" ! style="width: 140px;" | Left ! style="width: 150px;" | Center ! style="width: 130px;" | Right |- style="text-align: center;" | style="border: 1px solid blue;"| [[File:Starred.svg |120px]] | style="border: 1px solid #777777;"| [[File:Star full.svg |120px]] | style="border: 1px solid #22AA55;"|<!-- greenish border --> [[File:Stargreen.svg |120px]] |- style="text-align: center;" |Red star || Orange star || Green star |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| style="border-spacing: 2px; border: 1px solid darkgray;" ! style="width: 140px;" | Left ! style="width: 150px;" | Center ! style="width: 130px;" | Right |- style="text-align: center;" | style="border: 1px solid blue;"| [[File:Starred.svg |120px]] | style="border: 1px solid #777777;"| [[File:Star full.svg |120px]] | style="border: 1px solid #22AA55;"|<!-- greenish border --> [[File:Stargreen.svg |120px]] |- style="text-align: center;" |Red star || Orange star || Green star |} </div> Note that only the image cells have individual borders, not the text. The lower hex-colors (such as: <code>#616161</code>) are closer to black. Typically, all borders in a table would be one specific color. ;Border styles The <code>style='border:'</code> and <code>style='border-style:'</code> properties can accept the following arguments: {| style="border-spacing: 5px;" ! Argument ! Cell border ! Additional notes |- |<code>none</code> |style="padding: 1em; border-style: none;"|<samp>style="border-style: none;"</samp> |style="padding: 1em;"| |- |<code>solid</code> |style="padding: 1em; border-style: solid;"|<samp>style="border-style: solid;"</samp> |style="padding: 1em;"| |- |<code>double</code> |style="padding: 1em; border-style: double;"|<samp>style="border-style: double;"</samp> |style="padding: 1em;"| |- |<code>dashed</code> |style="padding: 1em; border-style: dashed;"|<samp>style="border-style: dashed;"</samp> |style="padding: 1em;"| |- |<code>dotted</code> |style="padding: 1em; border-style: dotted;"|<samp>style="border-style: dotted;"</samp> |style="padding: 1em;"| |- |<code>ridge</code> |style="padding: 1em; border:5px ridge red;"|<samp>style="border:5px ridge red;"</samp> |style="padding: 1em;"|3D ridged border |- |<code>groove</code> |style="padding: 1em; border:5px groove blue;"|<samp>style="border:5px groove blue;"</samp> |style="padding: 1em;"|3D grooved border |- |<code>inset</code> |style="padding: 1em; border: 5px inset yellow;"|<samp>style="border: 5px inset yellow;"</samp> |style="padding: 1em;"|3D inset border |- |<code>outset</code> |style="padding: 1em; border: 5px outset cyan;"|<samp>style="border: 5px outset cyan;"</samp> |style="padding: 1em;"|3D outset border |- |<code>inherit</code> |style="padding: 1em; border-style: inherit;"|<samp>style="border-style: inherit;"</samp> |style="padding: 1em;"|Inherit value from parent |- |<code>initial</code> |style="padding: 1em; border-style: initial;"|<samp>style="border-style: initial;"</samp> |style="padding: 1em;"|Set to default value |} ;Borders of a cell using <code>border-top</code>, <code>border-right</code>, <code>border-bottom</code>, <code>border-left</code> <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| ! style="border-top: solid;" | <code>style="border-top: solid;"</code> |- | style="border-top: solid 2px red; border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;" |<pre>border-top: solid 2px red; border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;</pre> |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| ! style="border-top: solid;" | <code>style="border-top: solid;"</code> |- | style="border-top: solid 2px red; border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;" |<pre>border-top: solid 2px red; border-right: dashed 3px green; border-bottom: double 5px blue; border-left: dotted 6px yellow;</pre> |} </div> ;Top, right, bottom, and left borders of a cell using <code>style='border-style:'</code> To set the left, right, bottom, or top border of a single cell, one may use <code>style='border-style:'</code> which takes between 1 and 4 arguments, each of which is either <code>none</code>, <code>solid</code>, <code>double</code>, <code>dotted</code>, <code>dashed</code>, <code>groove</code>, <code>ridge</code>, <code>inset</code>, <code>outset</code>, <code>inherit</code>, or <code>initial</code>. These arguments are ordered according to the [[#Clock order|§ pattern described here]]. For instance, <code>style="border-style: solid none solid none;"</code> where the four parameters correspond respectively to the<br> {{in5}}<code>'border-style: top right bottom left;'</code><br> borders of the cell. For reasons described after this example, there are many ways to change the following {{em|code}} that would '''{{em|not}}''' result in any changes to the table that is actually {{em|displayed}}. <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- | Top_Left <!-- border-style: top right bottom left; --> | style="border-style: solid solid none none;" | Top_Center | Top_Right |- | style="border-style: none none solid solid;" | Middle_Left | style="border-style: none none none none;" | Middle_Center | style="border-style: solid solid none none;" | Middle_Right |- | Bottom_Left | style="border-style: none none solid solid;" | Bottom_Center | Bottom_Right |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | Top_Left | style="border-style: solid solid none none;" | Top_Center | Top_Right |- | style="border-style: none none solid solid;" | Middle_Left | style="border-style: none none none none;" | Middle_Center | style="border-style: solid solid none none;" | Middle_Right |- | Bottom_Left | style="border-style: none none solid solid;" | Bottom_Center | Bottom_Right |} </div> Note, however, that in the following table, none of the central cell's (i.e. <code>Middle_Center</code>'s) borders are removed despite the code <code>style="border-style: none none none none;"</code>: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- | Top_Left || Top_Center || Top_Right |- | Middle_Left | style="border-style: none none none none;" | Middle_Center | Middle_Right |- | Bottom_Left || Bottom_Center || Bottom_Right |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | Top_Left || Top_Center || Top_Right |- | Middle_Left | style="border-style: none none none none;" | Middle_Center | Middle_Right |- | Bottom_Left || Bottom_Center || Bottom_Right |} </div> This happens because the code <code>class="wikitable"</code> places a border (top, right, bottom, and left) around {{em|every}} cell in the table so that, for instance, there are actually {{em|two}} 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" {{em|and}} the left border of "Middle_Right": <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- | Top_Left || Top_Center || Top_Right |- | Middle_Left <!-- 'border-style: top right bottom left;' --> | style="border-style: none none none none;" | Middle_Center | style="border-style: none none none none;" | Middle_Right <!-- In the above line, the three left-most "none" arguments can be replaced with "solid" (or other valid arguments) and there would be no change to the table that is displayed. Only the fourth argument, which is Middle_Right's left border, needs to be "none". For example, the line above could be replaced with: | style="border-style: solid solid solid none;" | Middle_Right --> |- | Bottom_Left || Bottom_Center || Bottom_Right |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | Top_Left || Top_Center || Top_Right |- | Middle_Left | style="border-style: none none none none;" | Middle_Center | style="border-style: none none none none;" | Middle_Right |- | Bottom_Left || Bottom_Center || Bottom_Right |} </div> To remove selected external borders of a wikitable, both remove them from the adjacent cells and begin the whole table with code like <code>{| class="wikitable" style="border: none;"</code>. Note that replacing <code>{| class="wikitable"</code> with<br> {{in5}}<code>{| style="border-collapse: collapse;"</code><br> 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 {{em|insert}} a {{em|single}} cell border between two adjacent cells rather than remove {{em|two}} cell borders. === Table cell templates === {{See also|Template:Shade}} See {{tl|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" ({{Tlx|Yes}}), "No" ({{Tlx|No}}), "—" ({{Tlx|N/A}}), "[[N/A]]" ({{Tlx|N/A|N/A}}), "?" ({{Tlx|dunno}}), on colored backgrounds. {| class="wikitable" |+ Template output for selected table cell templates ! Template usage !! Using template !! Without template |- ! {{tlc|Yes}} | {{Yes}} || Yes |- ! {{tlc|No}} | {{No}} || No |- ! {{tlc|Dunno}} | {{dunno}} || ? |- ! {{tlc|N/A}} | {{N/A}} || — |- ! {{tlc|N/A|N/A}} | {{N/A|N/A}} || N/A |- ! {{tlc|n/a|n/a}} | {{n/a|n/a}} || n/a |} For example, see [[Comparison of text editors]], which makes frequent use of table cell templates. === Tooltips === You can add tooltips to columns by using the {{T|Tooltip}} template. Simply replace the column-title with <code><nowiki>{{Tooltip|Column title|The tool tip}}</nowiki></code>, which makes it appear like so: {{tooltip|Column title|The tool tip}}. Use {{tl|abbr}} (same format) for abbreviations. For example: {{abbr|Pop|Population}}. == Workarounds == === Overflowing tables === {{hatnote|Note: [[Template:Sticky table start]] does the same thing, and also shortens the table vertically too via a vertical [[scrollbar]]. Such a scroll box is a problem though if the sticky headers are too large. In some cases, only a horizontal scrollbar (as below) may be desired. In that case [[Template:Sticky header]] may be preferred as long as the top sticky header is not too tall. The overflow code below can not be used with it, or sticky will not work. {{t|Sticky header}} scrolling is via the whole page, not just for the table.}} A horizontal scrollbar for the whole page shows up for any wikitable that is too wide for the screen. To create a scrollbar just for the table the following code may be used. Place the following code above a wikitable initialization: <syntaxhighlight lang="html" highlight="2" class=gridbox> <div class="overflowbugx" style="overflow-x:auto;"> </syntaxhighlight> Then, after the closing bracket for the wikitable, place the following code: <syntaxhighlight lang="html" highlight="2" class=gridbox> </div> </syntaxhighlight> This will prevent the table from causing the entire page to scroll when scrolling through the table horizontally. === Non-rectangular tables === {{tlx|diagonal split header|''HEADER-FOR-ROW-HEADERS''|''HEADER-FOR-COLUMN-HEADERS''}} can be used to diagonally split a header cell, as in the top-left cell in the rendered result below:<ref group=note>A simplified version of [[Template:Table_of_phase_transitions]]</ref> <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" highlight="2"> {| class=wikitable ! {{diagonal split header|From|To}} ! Solid !! Liquid !! Gas |- ! Solid | Solid-solid transformation || Melting || Sublimation |- ! Liquid | Freezing || {{sdash}} || Boiling/evaporation |- ! Gas | Deposition || Condensation || {{sdash}} |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable ! {{diagonal split header|From|To}} ! Solid !! Liquid !! Gas |- ! Solid | Solid-solid transformation || Melting || Sublimation |- ! Liquid | Freezing || {{sdash}} || Boiling/evaporation |- ! Gas | Deposition || Condensation || {{sdash}} |} </div> Cell borders can be hidden by adding {{xt|<code>border: none; background: none;</code>}} to the style attributes of either the table or the cell,<ref group=note>Applying <code>background: none</code> to the entire table will, perhaps predictably, subtly alter its color palette.</ref> though this may not work in older browsers. Another use case for this is for implementing aligned multi-column tables: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang="wikitext" highlight="2" style="white-space: pre-wrap;"> {| class=wikitable style="border: none; background: none;" ! colspan=2 rowspan=2 style="border: none; background: none;" | [[File:Pfeil_SO.svg |none|link=|20px]] ! colspan=3 | To |- ! Solid !! Liquid !! Gas |- ! rowspan=3 | From ! Solid | Solid–solid transformation || Melting || Sublimation |- ! Liquid | Freezing || {{sdash}} || Boiling/evaporation |- ! Gas | Deposition || Condensation || {{sdash}} |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable style="border: none; background: none;" ! colspan=2 rowspan=2 style="border: none; background: none;" | [[File:Pfeil_SO.svg |none|link=|20px]] ! colspan=3 | To |- ! Solid !! Liquid !! Gas |- ! rowspan=3 | From ! Solid | Solid–solid transformation || Melting || Sublimation |- ! Liquid | Freezing || {{sdash}} || Boiling/evaporation |- ! Gas | Deposition || Condensation || {{sdash}} |} </div> {{em|Note that the removal of the link on an image is [[WP:EIS#Link|dependent on it being purely decorative (as it will be ignored by assistive devices)]].}} <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" style="white-space: pre-wrap;"> {| class=wikitable style="border: none; background: none;" ! scope=col | Year ! scope=col | Size | rowspan=5 style="border: none; background: none;"| ! scope=col | Year ! scope=col | Size | rowspan=5 style="border: none; background: none;"| ! scope=col | Year ! scope=col | Size |- | 1990 || 1000<br>(est) || 2000 || 1357 || 2010 || 1776 |- | 1991 || 1010 || 2001 || 1471 || 2011 || 1888 |- | colspan=2 style="text-align: center;"|⋮ | colspan=2 style="text-align: center;"|⋮ | colspan=2 style="text-align: center;"|⋮ |- | 1999 || 1234 || 2009 || 1616 || 2019 || 1997<br>(est) |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable style="border: none; background: none;" ! scope=col | Year ! scope=col | Size | rowspan=5 style="border: none; background: none;"| ! scope=col | Year ! scope=col | Size | rowspan=5 style="border: none; background: none;"| ! scope=col | Year ! scope=col | Size |- | 1990 || 1000<br>(est) || 2000 || 1357 || 2010 || 1776 |- | 1991 || 1010 || 2001 || 1471 || 2011 || 1888 |- | colspan=2 style="text-align: center;"|⋮ | colspan=2 style="text-align: center;"|⋮ | colspan=2 style="text-align: center;"|⋮ |- | 1999 || 1234 || 2009 || 1616 || 2019 || 1997<br>(est) |} </div> === Rendering the pipe === {{anchor|Rendering_pipe_itself}} When cell ''content'' that contains a [[vertical bar|pipe]] character does not render correctly, simply add an empty format for that cell. The second pipe character in a line of <code>|''cell code''</code> 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. {{Crossref|selfref=no|(For a real format, see {{section link||HTML attributes}}.)}} Use a third pipe character to render your first pipe character. <div class="box"> Rendering the first pipe when it is the third pipe in the cell code. '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- | ''formatting'' |P|i|p|e| |C|e|l|l|2| |- | ''formatting'' |P|i|p|e|| ''formatting'' |C|e|l|l|2| |- ||P|i|p|e|s|| C|e|l|l|2| |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | ''formatting'' |P|i|p|e| |C|e|l|l|2| |- | ''formatting'' |P|i|p|e|| ''formatting'' |C|e|l|l|2| |- ||P|i|p|e|s|| C|e|l|l|2| |} </div> 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) {{tag|nowiki|content={{!}}}} (preferred) or 2) [[html#Character and entity references| html]]: <code>&#124;</code> or <code>&#x7C;</code>. Each line of cell code in the following table has one wikicode pipe. <div class="box"> Displaying adjacent pipes '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- |<nowiki>|</nowiki> Pipes34:<nowiki>||</nowiki> |- || Pipes34:|| |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- |<nowiki>|</nowiki> Pipes34:<nowiki>||</nowiki> |- || Pipes34:|| |} </div> Template {{tl2|!}}, because of the order in which things are parsed, is equivalent to typing in a single | pipe character. The single <code>[[help:nowiki|<nowiki />]]|</code> parser-tag does not apply here. See how they do not [[escape character|escape]] the second pipe, as &#124 and {{tag|nowiki|content={{!}}}} did above: <div class="box"> Common mechanisms that do not work in tables. '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- |<nowiki />| Pipe3:| |- |Pipe2:{{!}} Pipe3:{{!}} |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- |<nowiki />| Pipe3:| |- |Pipe2:{{!}} Pipe3:{{!}} |} </div> == Classes == {{See Also|Help:User style|Help:CSS}} There are several other [[Cascading Style Sheets|CSS]] classes, besides the basic <code>class=wikitable</code>, documented [[#Class|§ above]]. In the first line of table code, after the <code>{|</code>, 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 [[#Sorting|§ 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 [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/shared.css?view=markup 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 <code>{|</code>. 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: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {| style="border-spacing: 2px;" |+ Multiplication table |- ! scope=col | × ! scope=col | 1 ! scope=col | 2 ! scope=col | 3 |- ! scope=row | 1 | 1 || 2 || 3 |- ! scope=row | 2 | 2 || 4 || 6 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| style="border-spacing: 2px;" |+ Multiplication table |- ! scope=col | × ! scope=col | 1 ! scope=col | 2 ! scope=col | 3 |- ! scope=row | 1 | 1 || 2 || 3 |- ! scope=row | 2 | 2 || 4 || 6 |} </div> becomes this: <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {| class=wikitable |+ Multiplication table |- ! scope=col | × ! scope=col | 1 ! scope=col | 2 ! scope=col | 3 |- ! scope=row | 1 | 1 || 2 || 3 |- ! scope=row | 2 | 2 || 4 || 6 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |+ Multiplication table |- ! scope=col | × ! scope=col | 1 ! scope=col | 2 ! scope=col | 3 |- ! scope=row | 1 | 1 || 2 || 3 |- ! scope=row | 2 | 2 || 4 || 6 |} </div> simply by replacing inline CSS for the table by <code>class=wikitable</code>. This is because the <code>wikitable</code> class in [[MediaWiki:Common.css]] contains a number of <code>table.wikitable</code> 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: <div style="display:inline-grid; border: 2px solid; padding: 3px; max-width:30em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable style="font-style: italic; font-size: 120%; border: 3px dashed red;" |+ Multiplication table |- ! scope=col | × ! scope=col | 1 ! scope=col | 2 ! scope=col | 3 |- ! scope=row | 1 | 1 || 2 || 3 |- ! scope=row | 2 | 2 || 4 || 6 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable style="font-style: italic; font-size: 120%; border: 3px dashed red;" |+ Multiplication table |- ! scope=col | × ! scope=col | 1 ! scope=col | 2 ! scope=col | 3 |- ! scope=row | 1 | 1 || 2 || 3 |- ! scope=row | 2 | 2 || 4 || 6 |} </div> Notice that the table retains the gray background of the <code>wikitable</code> class, and the headers are still bold and centered. But now the text formatting has been overridden by the local <code>style=</code> 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. == Indenting tables == While tables should not normally be indented, when their surrounding paragraphs are also indented, you can indent tables using <code>margin-left</code>. To achieve the same indentation as a colon, use <code>margin-left:1.6em</code>. <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext"> {| class="wikitable" style="margin-left:1.6em;" |- ! Header 1 ! Header 2 |- | row 1, cell 1 | row 1, cell 2 |- | row 2, cell 1 | row 2, cell 2 |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class="wikitable" style="margin-left:1.6em;" |- ! Header 1 ! Header 2 |- | row 1, cell 1 | row 1, cell 2 |- | row 2, cell 1 | row 2, cell 2 |} </div> === Tables on talk pages === {{notice|'''''Note:''' Concerning colons on talk pages, see comments '''[[Wikipedia talk:Manual of Style/Accessibility/Archive 16#Paragraph breaks in a comment|here]]''' from a blind editor (Graham87) who uses a [[screen reader]]. Scroll down to the table comments. It also verifies the previous section above.''}} Note that indentation applied to only the ''first line'' of the table wikitext (the line that begins with "<code><nowiki>{|</nowiki></code>") is sufficient to indent the entire table. <code><nowiki>:::{| class=wikitable</nowiki></code> 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. == See also == {{hatnote|'''Note:''' See [[#top|top of page]] for more links to table help pages.}} * [[:Category:Wikipedia tables]]: lists even more table help pages. * [[Help:Introduction to tables with Wiki Markup]]. * [[Wikipedia:Manual of Style/Tables]]: the Manual of Style indicates best practices for tables. ** [[Wikipedia:Table dos and don'ts]]: a quick guide to the Manual of Style for tables. * [[mw:Help:Tables]] * [[User:Dcljr/Tables]]: table tutorials. * [[Table (HTML)]]: tags used for HTML tables. * [[:Category:Lists]]: vast category tree of pages with tables. === Templates === * [[:Category:Table templates]]: 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]] * {{tl|List to table}}: template and its maintenance category: [[:Category:Articles requiring tables]] * {{tl|Horizontal TOC}}: good for country lists in table format. * {{tl|Diagonal split header}}: for identifying both rows and columns, in a diagonally split top-left cell (also: {{tl|Diagonal split header 2}}) * {{tl|Table}}: template for specifying table CSS classes such as "wikitable" and "collapsible" * {{Tl|Alternating rows table}} * {{t|Screen reader-only}}: for a table caption directly below a section heading, or table description. * {{tl|Aligned table}}: for specifying tables as a template, allowing inclusion in other templates and areas where table syntax is problematic. ** Examples: ** {{tl|Chess diagram}}: chess board template. ** {{tl|Goban}}: Go board template. Some commonly used table templates using [[wp:TemplateStyles|TemplateStyles]]: *{{tl|Sticky header}}: makes top header rows sticky. *{{tl|Sticky table start}} and {{tl|Sticky table end}}: makes top and side header rows sticky, and puts table in scroll box. *{{tl|Sort under}}: puts sorting arrows below headers. *{{tl|Mw-datatable}}: rows highlighted via mouse hover. White background otherwise. *{{tl|Table alignment}}: aligns text in selected columns. *{{tl|Static row numbers}}: adds column of fixed row numbers. == Notes == {{reflist|group=note}} == External links == * [https://toolhub.wikimedia.org/search?q=table Table tools] at [https://toolhub.wikimedia.org toolhub.wikimedia.org] * Convert range of cells from Excel to wiki text ** [https://excel2wiki.toolforge.org Excel2Wiki - copy/paste Excel-to-Wiki converter] at [[labsconsole:Portal:Toolforge|Toolforge]] (in-browser copy and paste) ** [[:de:Wikipedia:Technik/Text/Basic/EXCEL-Tabellenumwandlung/en|VBA-Macro for EXCEL tableconversion]] (macro requiring quick installation) ** [https://magnustools.toolforge.org/tab2wiki.php Tab2Wiki] at [[labsconsole:Portal:Toolforge|Toolforge]] (in-browser copy and paste) * [https://www.tablesgenerator.com/mediawiki_tables Tables Generator], a WYSIWYG table generator for Mediawiki markup * [http://wikitable.eu5.org/ Wikitable Editor], a table editor of wiki code that outputs visual preview quickly * [https://magnustools.toolforge.org/html2wiki.php HTML2Wiki Converter] at [https://wikitech.wikimedia.org/wiki/Portal:Toolforge toolforge.org] * [https://metacpan.org/author/DIBERRI HTML-WikiConverter], various versions and languages * [http://pywikipediabot.sourceforge.net/ pywikipediabot], can convert HTML tables to wiki * [http://www.w3.org/TR/css3-color/ Table of CSS color names and HEX codes] * [[phab:T42763|Phabricator request]] for floating table headers *[https://pypi.org/project/tabulate/ tabulate], Python module for converting data structures to wiki table markup *[https://pypi.org/project/wikitables/ wikitables], Python module for reading wiki table markup *[https://www.w3.org/TR/2008/NOTE-WCAG20-TECHS-20081211/H63.html H63: Using the scope attribute to associate header cells and data cells in data tables | Techniques for WCAG 2.0]. *[https://usability.yale.edu/web-accessibility/articles/tables Tables | Usability & Web Accessibility]. [[Yale University]]. *[https://www.w3.org/WAI/tutorials/tables/multi-level Tables with Multi-Level Headers]. [[Web Accessibility Initiative]]. [[W3C]]. Also shows alternatives to complex tables. ===Wikimedia sister projects=== * {{Wikibooks-inline|Editing Wikitext/Tables}} * {{Wikibooks-inline|Editing Wikitext/Tables Ready to Use}} * [[mw:Help:Tables]]: MediaWiki help page on tables. * [[mw:Help:Sortable tables]]: MediaWiki help page on sortable tables. * [[mw:Table background colors]]: MediaWiki help page on table background colors. * [[commons:Commons:Chart and graph resources|Commons:Chart and graph resources]]: Chart and graph resources at Commons * [[commons:Commons:Convert tables and charts to wiki code or image files|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. [[Commons:File talk:Template map of US states and District of Columbia.svg/Instructions|Convert US list/table to state-by-state SVG map]]. {{Introduction/navigation|state=expanded}} {{Help navigation}} {{Wikipedia technical help|collapsed}} [[Category:Wikipedia tables| ]] [[Category:Wikipedia how-to]] [[Category:Wikipedia text help]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Abbr
(
edit
)
Template:Anchor
(
edit
)
Template:As of
(
edit
)
Template:Clear
(
edit
)
Template:Crossref
(
edit
)
Template:DRC
(
edit
)
Template:Diagonal split header
(
edit
)
Template:Dummy ref
(
edit
)
Template:Dunno
(
edit
)
Template:Efn
(
edit
)
Template:Em
(
edit
)
Template:For
(
edit
)
Template:Further
(
edit
)
Template:Hairspace
(
edit
)
Template:Hatnote
(
edit
)
Template:Help navigation
(
edit
)
Template:In5
(
edit
)
Template:Introduction/navigation
(
edit
)
Template:Kbd
(
edit
)
Template:Lorem ipsum
(
edit
)
Template:Lorem ipsum span
(
edit
)
Template:MOZ
(
edit
)
Template:Main
(
edit
)
Template:More
(
edit
)
Template:Mw-datatable
(
edit
)
Template:N/A
(
edit
)
Template:N/a
(
edit
)
Template:Nbsp
(
edit
)
Template:No
(
edit
)
Template:Notice
(
edit
)
Template:Nowrap
(
edit
)
Template:Oldid2
(
edit
)
Template:Reflist
(
edit
)
Template:Sdash
(
edit
)
Template:See Also
(
edit
)
Template:See also
(
edit
)
Template:See below
(
edit
)
Template:Sh
(
edit
)
Template:Short description
(
edit
)
Template:Shortcut
(
edit
)
Template:Slink
(
edit
)
Template:Sort under
(
edit
)
Template:Space
(
edit
)
Template:Sro
(
edit
)
Template:Static row numbers
(
edit
)
Template:Sticky header
(
edit
)
Template:T
(
edit
)
Template:Table alignment
(
edit
)
Template:Table help
(
edit
)
Template:Tag
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Template:Tl2
(
edit
)
Template:Tlc
(
edit
)
Template:Tlx
(
edit
)
Template:Tooltip
(
edit
)
Template:Var
(
edit
)
Template:Vertical header
(
edit
)
Template:Visible anchor
(
edit
)
Template:Wiki markup
(
edit
)
Template:Wikibooks-inline
(
edit
)
Template:Wikipedia how to
(
edit
)
Template:Wikipedia technical help
(
edit
)
Template:Xt
(
edit
)
Template:Yes
(
edit
)
Help:Table/example row template
(
edit
)