<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Help%3ABasic_table_markup</id>
	<title>Help:Basic table markup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Help%3ABasic_table_markup"/>
	<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Help:Basic_table_markup&amp;action=history"/>
	<updated>2026-05-06T20:41:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Help:Basic_table_markup&amp;diff=22709&amp;oldid=prev</id>
		<title>Richardpruen: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Help:Basic_table_markup&amp;diff=22709&amp;oldid=prev"/>
		<updated>2022-01-02T17:20:25Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:20, 2 January 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-22708:rev-22709 --&gt;
&lt;/table&gt;</summary>
		<author><name>Richardpruen</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Help:Basic_table_markup&amp;diff=22708&amp;oldid=prev</id>
		<title>Wikipedia&gt;John of Reading: Reverted 1 edit by 180.241.168.113 (talk): The example markup should match the example table</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Help:Basic_table_markup&amp;diff=22708&amp;oldid=prev"/>
		<updated>2021-12-14T15:13:42Z</updated>

		<summary type="html">&lt;p&gt;Reverted 1 edit by &lt;a href=&quot;/mediawiki/index.php/Special:Contributions/180.241.168.113&quot; title=&quot;Special:Contributions/180.241.168.113&quot;&gt;180.241.168.113&lt;/a&gt; (&lt;a href=&quot;/mediawiki/index.php?title=User_talk:180.241.168.113&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:180.241.168.113 (page does not exist)&quot;&gt;talk&lt;/a&gt;): The example markup should match the example table&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Wikipedia how-to|H:BTM}}&lt;br /&gt;
This help page describes basic wiki markup for tables. For a more extensive guide please see [[Help:Table]].&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The markup for a basic table is the following. All this markup must start on a new line, except for &amp;lt;code&amp;gt;!!&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; (when used as an attribute separator).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;{|&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Table start&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| It opens a table&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;|+&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Table caption&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| It adds a caption.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Table row&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| It separates rows (but it is optional for the first row).&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;!&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Header cell&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| It adds a header cell, which can be optionally be placed on the next line.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;!!&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Header cells on the same line&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| Header cells may be added on the same line separated by double marks.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;|&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Data cell&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| It adds a data cell, which can be optionally be placed on the next line. Also see &amp;quot;attribute separator&amp;quot; below.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;||&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Data cells on the same line&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| Data cells may be added on the same line separated by double marks.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;|&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Attribute separator&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| It is used to separate HTML attributes from cell contents (both data or header), or caption contents.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;|}&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Table end&amp;#039;&amp;#039;&amp;#039;  &lt;br /&gt;
| It closes a table.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Example table===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:50%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: example table&lt;br /&gt;
|-&lt;br /&gt;
! header1&lt;br /&gt;
! header2&lt;br /&gt;
! header3&lt;br /&gt;
|-&lt;br /&gt;
| row1cell1&lt;br /&gt;
| row1cell2&lt;br /&gt;
| row1cell3&lt;br /&gt;
|-&lt;br /&gt;
| row2cell1&lt;br /&gt;
| row2cell2&lt;br /&gt;
| row2cell3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would produce:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: example table&lt;br /&gt;
|-&lt;br /&gt;
! header1&lt;br /&gt;
! header2&lt;br /&gt;
! header3&lt;br /&gt;
|-&lt;br /&gt;
| row1cell1&lt;br /&gt;
| row1cell2&lt;br /&gt;
| row1cell3&lt;br /&gt;
|-&lt;br /&gt;
| row2cell1&lt;br /&gt;
| row2cell2&lt;br /&gt;
| row2cell3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{|&amp;lt;/code&amp;gt; opens a table, and &amp;lt;code&amp;gt;|}&amp;lt;/code&amp;gt; closes it.  &amp;lt;code&amp;gt;class=&amp;quot;wikitable&amp;quot;&amp;lt;/code&amp;gt; is used with a lot of tables on Wikipedia, and adds some standard formatting, and follows on the same line as &amp;lt;code&amp;gt;{|&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;|+ Caption: example table&amp;lt;/code&amp;gt; adds the caption &amp;quot;Caption: example table&amp;quot; to the top of the table. The caption is optional.&lt;br /&gt;
&lt;br /&gt;
Columns headers are created by &amp;lt;code&amp;gt;!&amp;amp;nbsp;column&amp;amp;nbsp;name&amp;lt;/code&amp;gt;. Cells are created by &amp;lt;code&amp;gt;|&amp;amp;nbsp;cell&amp;amp;nbsp;text&amp;lt;/code&amp;gt;. The divider between rows is &amp;lt;code&amp;gt;|-&amp;lt;/code&amp;gt;. You can add an extra column by just sticking &amp;lt;code&amp;gt;!&amp;amp;nbsp;new&amp;amp;nbsp;column&amp;amp;nbsp;name&amp;lt;/code&amp;gt; at the end of the last column name. To fill the cells in that column, you need to add another cell to each row: fill it by typing &amp;lt;code&amp;gt;|&amp;amp;nbsp;cell&amp;amp;nbsp;text&amp;lt;/code&amp;gt;. If you want to add an extra row, just add &amp;lt;code&amp;gt;|-&amp;lt;/code&amp;gt; to the table, and fill it with however many cells are appropriate.&lt;br /&gt;
&lt;br /&gt;
The important thing to note is that there must be an equal number of cells on each line (unless overridden by rowspan or colspan, see below).&lt;br /&gt;
&lt;br /&gt;
Blank spaces at the beginning of a line are ignored. Thus &amp;lt;code&amp;gt;|row1cell1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;| row1cell1&amp;lt;/code&amp;gt; are identical. To add a pipe (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;) character into cell contents, you need to use the {{xtag|nowiki}} markup.&lt;br /&gt;
&lt;br /&gt;
===Using double marks with tables===&lt;br /&gt;
&lt;br /&gt;
All above markup must start on a new line. This includes the cell markup (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;). Double cell markup (&amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;!!&amp;lt;/code&amp;gt;) can be used to avoid this and to add consecutive cells to a single line. &lt;br /&gt;
&lt;br /&gt;
For example, this would produce the same table as above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:60%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: example table&lt;br /&gt;
|-&lt;br /&gt;
! header1 !! header2 !! header3&lt;br /&gt;
|-&lt;br /&gt;
| row1cell1 || row1cell2 || row1cell3&lt;br /&gt;
|-&lt;br /&gt;
| row2cell1 || row2cell2 || row2cell3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Column and row header cells===&lt;br /&gt;
&lt;br /&gt;
Header cells may be column or row header cells. For example, the following table has both:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:60%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: example table&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! columnheader1 &lt;br /&gt;
! columnheader2&lt;br /&gt;
|-&lt;br /&gt;
! rowheader1 &lt;br /&gt;
| row1cell1 &lt;br /&gt;
| row1cell2&lt;br /&gt;
|-&lt;br /&gt;
! rowheader2 &lt;br /&gt;
| row2cell1 &lt;br /&gt;
| row2cell2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which produces:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: example table&lt;br /&gt;
|-&lt;br /&gt;
! !! columnheader1 !! columnheader2&lt;br /&gt;
|-&lt;br /&gt;
! rowheader1 &lt;br /&gt;
| row1cell1 &lt;br /&gt;
| row1cell2&lt;br /&gt;
|-&lt;br /&gt;
! rowheader2 &lt;br /&gt;
| row2cell1 &lt;br /&gt;
| row2cell2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==HTML attributes==&lt;br /&gt;
&lt;br /&gt;
[[HTML attribute]]s are often needed to be added to tables for various reasons. Attributes take the basic form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;attribute=&amp;quot;value&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Multiple attributes can be applied by repeating this, like &amp;lt;code&amp;gt;attribute1=&amp;quot;value1&amp;quot; attribute2=&amp;quot;value2&amp;quot; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important points to realize: &lt;br /&gt;
* All table markup, except table end (&amp;lt;code&amp;gt;|}&amp;lt;/code&amp;gt;), optionally accepts one or more attributes on the same line.&lt;br /&gt;
* Cell markup (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;!!&amp;lt;/code&amp;gt;) and caption markup (&amp;lt;code&amp;gt;|+&amp;lt;/code&amp;gt;) hold content. So separate any attributes from content with a single pipe (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;), even when cell content is on a new line, which is permissible.&lt;br /&gt;
* Table and row markup (&amp;lt;code&amp;gt;{|&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;|-&amp;lt;/code&amp;gt;) do not directly hold content. Therefore, do &amp;#039;&amp;#039;not&amp;#039;&amp;#039; add a pipe (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;) after any attributes.&lt;br /&gt;
&lt;br /&gt;
===Adding HTML attributes to cells and captions===&lt;br /&gt;
This is how to cell contents, including header cell contents, and also captions.&lt;br /&gt;
&lt;br /&gt;
Cells hold content, e.g. &amp;lt;code&amp;gt;row1cell1&amp;lt;/code&amp;gt;. The markup for cells and captions are: &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;!!&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;|+&amp;lt;/code&amp;gt;. Attributes need to be kept separate from cell content or captions with a single pipe (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;). Cell content or captions may follow on the same line, or on a following line.&lt;br /&gt;
&lt;br /&gt;
So attributes can be inserted like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:30%&amp;quot;&amp;gt;&lt;br /&gt;
| attribute=&amp;quot;value&amp;quot; | row1cell1&lt;br /&gt;
| attribute=&amp;quot;value&amp;quot; | row1cell2&lt;br /&gt;
| attribute=&amp;quot;value&amp;quot; | row1cell3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;attribute=&amp;quot;value&amp;quot;&amp;lt;/code&amp;gt; indicates one or more attribute, for example &amp;lt;code&amp;gt;style=&amp;quot;color: red&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the cells are on the same line, attributes can be added like this:  &amp;lt;code&amp;gt;| attribute=&amp;quot;value&amp;quot; | row1cell1 || attribute=&amp;quot;value&amp;quot; | row1cell2 || attribute=&amp;quot;value&amp;quot; | row1cell3 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adding to the &amp;#039;&amp;#039;header&amp;#039;&amp;#039; can be done like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:30%&amp;quot;&amp;gt;&lt;br /&gt;
! attribute=&amp;quot;value&amp;quot; | header1&lt;br /&gt;
! attribute=&amp;quot;value&amp;quot; | header2&lt;br /&gt;
! attribute=&amp;quot;value&amp;quot; | header3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or like this: &amp;lt;code&amp;gt;! attribute=&amp;quot;value&amp;quot; | header1 !! attribute=&amp;quot;value&amp;quot; | header2 !! attribute=&amp;quot;value&amp;quot; | header3 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adding to the &amp;#039;&amp;#039;caption&amp;#039;&amp;#039; is done like this: &amp;lt;code&amp;gt; |+ attribute=&amp;quot;value&amp;quot; | Caption Title &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, lets say we wanted to make some cells&amp;#039; text red colored. The attribute to do so is &amp;lt;code&amp;gt;style=&amp;quot;color: red&amp;quot;&amp;lt;/code&amp;gt;. It could be added to some cells in a table like this:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:70%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: some cells red text.&lt;br /&gt;
|-&lt;br /&gt;
! header1&lt;br /&gt;
! header2&lt;br /&gt;
! header3&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color: red&amp;quot; | row1cell1&lt;br /&gt;
| row1cell2&lt;br /&gt;
| style=&amp;quot;color: red&amp;quot; | row1cell3&lt;br /&gt;
|-&lt;br /&gt;
| row2cell1&lt;br /&gt;
| style=&amp;quot;color: red&amp;quot; | row2cell2&lt;br /&gt;
| row2cell3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it would produce this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: some cells red text.&lt;br /&gt;
|-&lt;br /&gt;
! header1&lt;br /&gt;
! header2&lt;br /&gt;
! header3&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color: red&amp;quot; | row1cell1&lt;br /&gt;
| row1cell2&lt;br /&gt;
| style=&amp;quot;color: red&amp;quot; | row1cell3&lt;br /&gt;
|-&lt;br /&gt;
| row2cell1&lt;br /&gt;
| style=&amp;quot;color: red&amp;quot; | row2cell2&lt;br /&gt;
| row2cell3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can see, a red color has been added to some of the cells&amp;#039; text. Note that, optionally, cell contents could be added to new lines if desired.&lt;br /&gt;
&lt;br /&gt;
===Adding HTML attributes to whole tables and rows===&lt;br /&gt;
Tables and rows use the following markup: &amp;lt;code&amp;gt;{|&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;|-&amp;lt;/code&amp;gt; and  &amp;lt;code&amp;gt;|}&amp;lt;/code&amp;gt;. Attributes can be added to &amp;lt;code&amp;gt;{|&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;|-&amp;lt;/code&amp;gt;. They do not directly hold content. Because of this, they should &amp;#039;&amp;#039;not&amp;#039;&amp;#039; have an added pipe (&amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;) after any attributes.&lt;br /&gt;
&lt;br /&gt;
Attributes can be added to the table markup like this: &amp;lt;code&amp;gt;{| attribute=&amp;quot;value&amp;quot;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;attribute=&amp;quot;value&amp;quot;&amp;lt;/code&amp;gt; indicates one or more attributes.&lt;br /&gt;
&lt;br /&gt;
Attributes can be added to the row markup like this: &amp;lt;code&amp;gt;|- attribute=&amp;quot;value&amp;quot;&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
An example is the &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{| class=&amp;quot;wikitable&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
used before, that applies a class to an entire table. Likewise you could add a second attribute: for example, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;color:red&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
would apply two attributes, class and style. That style attribute would give text a red color.&lt;br /&gt;
&lt;br /&gt;
An example of an attribute applied to a table row:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;|- style=&amp;quot;height: 100px&amp;quot;&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
would apply a style attribute, in this case to make the height of a table row 100px.&lt;br /&gt;
&lt;br /&gt;
===Commonly included===&lt;br /&gt;
Commonly included HTML attributes in tables include:&lt;br /&gt;
&lt;br /&gt;
;class: For example &amp;lt;code&amp;gt;class=&amp;quot;wikitable&amp;quot;&amp;lt;/code&amp;gt;. The [[Wikipedia:Catalogue of CSS classes|class attribute]] is normally applied to a complete table. Other classes include &amp;lt;code&amp;gt;class=&amp;quot;wikitable sortable&amp;quot;&amp;lt;/code&amp;gt; (sortable tables) and &amp;lt;code&amp;gt;class=&amp;quot;wikitable mw-collapsible&amp;quot;&amp;lt;/code&amp;gt; (collapsing tables).&lt;br /&gt;
;style: For example &amp;lt;code&amp;gt;style=&amp;quot;color:red&amp;quot;&amp;lt;/code&amp;gt;. It is used for &amp;#039;&amp;#039;CSS&amp;#039;&amp;#039; ([[Cascading Style Sheets]]) styling, and can be applied to whole tables, table captions, table rows and individual cells.&lt;br /&gt;
;rowspan: For example &amp;lt;code&amp;gt;rowspan=&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt;. Used for formatting table rows and cells so they extend beyond their normal extent of one row, in this example two rows.&lt;br /&gt;
;colspan: For example &amp;lt;code&amp;gt;colspan=&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt;. Used for formatting table rows and cells so they extend beyond their normal extent of one column, in this example two columns.&lt;br /&gt;
;scope: For example &amp;lt;code&amp;gt;scope=&amp;quot;col&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;scope=&amp;quot;row&amp;quot;&amp;lt;/code&amp;gt;. Not essential, but specifies that the cell is either a header for a column or row. Use &amp;lt;code&amp;gt;scope=&amp;quot;colgroup&amp;quot; colspan=&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;scope=&amp;quot;rowgroup&amp;quot; rowspan=&amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; to specify that the cell is a header for a group of columns or rows.&lt;br /&gt;
&lt;br /&gt;
Other HTML attributes are used with tables, but many are deprecated by [[HTML5]]. See [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table &amp;quot;table&amp;quot;], [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption &amp;quot;caption&amp;quot;], [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr &amp;quot;table row&amp;quot;], [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th &amp;quot;header cell&amp;quot;] and [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td &amp;quot;data cell&amp;quot;] for some deprecated attributes.&lt;br /&gt;
&lt;br /&gt;
==Cell contents on new lines==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Cell content&amp;#039;&amp;#039; may follow on the same line after its &amp;#039;&amp;#039;cell markup&amp;#039;&amp;#039; (which may include attributes); or on lines below the cell markup. &lt;br /&gt;
&lt;br /&gt;
Cell content that uses its own markup may need to start on a new line; this can happen with things like lists, headings, or nested tables.&lt;br /&gt;
&lt;br /&gt;
For example, take the following single row table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:70%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ One row table&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | cell1&lt;br /&gt;
| cell2&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | cell3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its output is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ One row table&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | cell1&lt;br /&gt;
| cell2&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | cell3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cell contents can be added to new lines if so desired:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:70%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ One row table&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | &lt;br /&gt;
cell1&lt;br /&gt;
| &lt;br /&gt;
cell2&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | &lt;br /&gt;
cell3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its output is similar, but the vertical height is increased:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ One row table&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | &lt;br /&gt;
cell1&lt;br /&gt;
| &lt;br /&gt;
cell2&lt;br /&gt;
| style=&amp;quot;color:blue&amp;quot; | &lt;br /&gt;
cell3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==How tables are formed==&lt;br /&gt;
If you use the following wiki markup for a table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:60%&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Caption: example table&lt;br /&gt;
|-&lt;br /&gt;
! header1&lt;br /&gt;
! header2&lt;br /&gt;
! header3&lt;br /&gt;
|-&lt;br /&gt;
| row1cell1&lt;br /&gt;
| row1cell2&lt;br /&gt;
| row1cell3&lt;br /&gt;
|-&lt;br /&gt;
| row2cell1&lt;br /&gt;
| row2cell2&lt;br /&gt;
| row2cell3&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[MediaWiki]] software translates it into the following [[HTML]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; style=&amp;quot;width:60%&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;caption&amp;gt;Caption: example table&amp;lt;/caption&amp;gt;&lt;br /&gt;
&amp;lt;tbody&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;header1&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;header2&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;header3&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;row1cell1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;row1cell2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;row1cell3&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;row2cell1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;row2cell2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;row2cell3&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The {{Tag|table}} tags opens and closes the table. The {{Tag|caption}} tags adds a caption. The {{Tag|tr}} tags opens and closes table rows. The {{Tag|th}} tags adds a header cell. The {{Tag|td}} tags adds a data cell. The optional {{Tag|tbody}} tags defines where the table body starts and ends.&lt;br /&gt;
&lt;br /&gt;
HTML attributes can be added by insertion within the opening tag. For example &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; can have an attribute added like this: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;table attribute=&amp;quot;value&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;table attribute1=&amp;quot;value1&amp;quot; attribute2=&amp;quot;value2&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; for two attributes. All other tags follow the same rule.&lt;br /&gt;
&lt;br /&gt;
You can add a table using HTML coding rather than wiki markup, as described at [[HTML element#Tables]]. However it is discouraged due to readability reasons; see the [[Wikipedia:Manual of Style/Tables|manual of style on tables]]. Also, note that the {{Tag|thead|o}}, {{Tag|tbody|o}}, {{Tag|tfoot|o}}, {{Tag|colgroup|o}}, and {{Tag|col|o}} tags are [[Help:HTML in wikitext#Tables|not supported in wikitext]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
For further help with tables, see: &lt;br /&gt;
&lt;br /&gt;
* [[Help:Introduction to tables with Wiki Markup]], a brief introduction to tables&lt;br /&gt;
* [[Help:Table]], an in-depth and comprehensive guide to tables&lt;br /&gt;
* [[Help:Sorting]], sortable tables typically use &amp;lt;code&amp;gt;class=&amp;quot;wikitable sortable&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* [[Help:Collapsing]], collapsing tables typically uses &amp;lt;code&amp;gt;class=&amp;quot;wikitable mw-collapsible&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* {{Wikibooks-inline|Editing Wikitext/Tables}}&lt;br /&gt;
* {{Wikibooks-inline|Editing Wikitext/Tables Ready to Use}}&lt;br /&gt;
* [[Wikipedia:Manual of Style/Tables]], the Manual of Style for best practices for tables&lt;br /&gt;
** [[Wikipedia:Table dos and don&amp;#039;ts]], a quick guide to the Manual of Style for tables&lt;br /&gt;
* [[Wikipedia:Advanced table formatting]], some advanced techniques&lt;br /&gt;
&lt;br /&gt;
[[Category:Wikipedia how-to]]&lt;br /&gt;
[[Category:Wikipedia tables]]&lt;br /&gt;
&lt;br /&gt;
{{Wikipedia technical help}}&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;John of Reading</name></author>
	</entry>
</feed>