Help:Tables

From Celeste Wiki
Jump to navigation Jump to search

<languages/> Template:PD Help Page

<translate> Tables redirects here; for information about database table structure, see <tvar|1>Template:Ll</>.</translate>

<translate> Tables may be created in wiki pages.</translate> <translate> As a general rule, it is best to avoid using a table unless you need one.</translate> <translate> Table markup often complicates page editing.</translate>[1]

<translate>

Wiki table markup summary[edit source]

</translate>

{| <translate> table start, required</translate>
|+ <translate> table caption, optional; only between table start and table row</translate>
|- <translate> table row, optional on first row—wiki engine assumes the first row</translate>
! <translate> table header cell, optional.</translate> <translate> Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!).</translate>
| <translate> table data cell, optional.</translate> <translate> Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|).</translate>
|} <translate> table end, required</translate>

<translate>

  • The above marks must start on a new line except the double || and !! for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.</translate>
  • <translate> HTML attributes.</translate> <translate> Each mark, except table end, optionally accepts one or more HTML attributes.</translate> <translate> Attributes must be on the same line as the mark.</translate> <translate> Separate attributes from each other with a single space.</translate>

<translate>

    • Cells and caption (| or ||, ! or !!, and |+) hold content.</translate> <translate> So separate any attributes from content with a single pipe (|).</translate> <translate> Cell content may follow on same line or on following lines.</translate>

<translate>

    • Table and row marks ({| and |-) do not directly hold content.</translate> <translate> Do not add pipe (|) after their optional attributes.</translate> <translate> If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it and your final attribute if it was touching the erroneous pipe!</translate>

<translate>

  • Content may (a) follow its cell mark on the same line after any optional HTML attributes or (b) on lines below the cell mark.</translate> <translate> Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.</translate>

<translate>

    • Pipe character as content.</translate> <translate> To insert a pipe (|) character into a table, use the <nowiki>|</nowiki> escaping markup.</translate>

<translate>

Basics[edit source]

The following table lacks borders and good spacing but shows the simplest wiki markup table structure. </translate>

<translate> You type</translate> <translate> You get</translate>
{|
|<translate nowrap><!--T:33--> Orange</translate>
|<translate nowrap><!--T:34--> Apple</translate>
|-
|<translate nowrap><!--T:35--> Bread</translate>
|<translate nowrap><!--T:36--> Pie</translate>
|-
|<translate nowrap><!--T:37--> Butter</translate>
|<translate nowrap><!--T:38--> Ice cream</translate> 
|}
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

<translate> The cells in the same row can be listed on one line separated by || (two pipe symbols).</translate> <translate> If the text in the cell should contain a line break, use <tvar|br><br/></> instead.</translate>

<translate> You type</translate> <translate> You get</translate>
{|
|<translate nowrap><!--T:47--> Orange</translate>||<translate nowrap><!--T:392--> Apple</translate>||<translate nowrap><!--T:393--> more</translate>
|-
|<translate nowrap><!--T:48--> Bread</translate>||<translate nowrap><!--T:394--> Pie</translate>||<translate nowrap><!--T:395--> more</translate>
|-
|<translate nowrap><!--T:49--> Butter</translate>||<translate nowrap><!--T:396--> Ice<br/>cream</translate>||<translate nowrap><!--T:403--> and<br/>more</translate>
|}
<translate> Orange</translate> <translate> Apple</translate> <translate> more</translate>
<translate> Bread</translate> <translate> Pie</translate> <translate> more</translate>
<translate> Butter</translate> <translate> Ice
cream</translate>
<translate> and
more</translate>

<translate> Extra spaces within cells in the wiki markup, as in the wiki markup below, do not affect the actual table rendering. </translate>

<translate> You type</translate> <translate> You get</translate>
{|
|  <translate nowrap><!--T:54--> Orange</translate> || <translate nowrap><!--T:380--> Apple</translate> || <translate nowrap><!--T:381--> more</translate>
|-
|   <translate nowrap><!--T:55--> Bread</translate> || <translate nowrap><!--T:382--> Pie</translate> || <translate nowrap><!--T:383--> more</translate>
|-
|   <translate nowrap><!--T:56--> Butter</translate> || <translate nowrap><!--T:384--> Ice cream</translate> || <translate nowrap><!--T:385--> and more</translate>
|}
<translate> Orange</translate> <translate> Apple</translate> <translate> more</translate>
<translate> Bread</translate> <translate> Pie</translate> <translate> more</translate>
<translate> Butter</translate> <translate> Ice cream</translate> <translate> and more</translate>

<translate> You can have longer text or more complex wiki syntax inside table cells, too: </translate>

<translate> You type</translate> <translate> You get</translate>
{|
|Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, 
sed diam nonumy eirmod tempor invidunt
ut labore et dolore magna aliquyam erat, 
sed diam voluptua. 

At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum
dolor sit amet. 
|
* Lorem ipsum dolor sit amet
* consetetur sadipscing elitr
* sed diam nonumy eirmod tempor invidunt
|}
Lorem ipsum dolor sit amet,

consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

  • Lorem ipsum dolor sit amet
  • consetetur sadipscing elitr
  • sed diam nonumy eirmod tempor invidunt

<translate>

Table headers[edit source]

</translate> <translate> Table headers can be created by using "!" (exclamation mark) instead of "|" (pipe symbol).</translate> <translate> Headers usually show up bold and centered by default.</translate>

<translate> You type</translate> <translate> You get</translate>
{|
! style="text-align:left;"| <translate nowrap><!--T:66--> Item</translate>
! <translate nowrap><!--T:67--> Amount</translate>
! <translate nowrap><!--T:68--> Cost</translate>
|-
|<translate nowrap><!--T:69--> Orange</translate>
|10
|7.00
|-
|<translate nowrap><!--T:70--> Bread</translate>
|4
|3.00
|-
|<translate nowrap><!--T:71--> Butter</translate>
|1
|5.00
|-
!<translate nowrap><!--T:72--> Total</translate>
|
|15.00
|}
<translate> Item</translate> <translate> Amount</translate> <translate> Cost</translate>
<translate> Orange</translate> 10 7.00
<translate> Bread</translate> 4 3.00
<translate> Butter</translate> 1 5.00
<translate> Total</translate> 15.00

|</>' is used for separation.</translate> <translate> Not an exclamation character '!'.</translate>">[[#ref_1>|</>' is used for separation.</translate> <translate> Not an exclamation character '!'.</translate>|^]] 

<translate>

Caption[edit source]

A table caption can be added to the top of any table as follows. </translate>

<translate> You type</translate> <translate> You get</translate>
{|
|+<translate nowrap><!--T:86--> Food complements</translate>
|-
|<translate nowrap><!--T:87--> Orange</translate>
|<translate nowrap><!--T:88--> Apple</translate>
|-
|<translate nowrap><!--T:89--> Bread</translate>
|<translate nowrap><!--T:90--> Pie</translate>
|-
|<translate nowrap><!--T:91--> Butter</translate>
|<translate nowrap><!--T:92--> Ice cream</translate> 
|}
<translate> Food complements</translate>
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

<translate>

class="wikitable"[edit source]

Basic styling (light gray background, borders, padding and align left) can be achieved by adding class="wikitable". </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
|+<translate nowrap><!--T:104--> Food complements</translate>
|-
|<translate nowrap><!--T:105--> Orange</translate>
|<translate nowrap><!--T:106--> Apple</translate>
|-
|<translate nowrap><!--T:107--> Bread</translate>
|<translate nowrap><!--T:108--> Pie</translate>
|-
|<translate nowrap><!--T:109--> Butter</translate>
|<translate nowrap><!--T:110--> Ice cream</translate> 
|}
<translate> Food complements</translate>
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

<translate>

HTML colspan and rowspan[edit source]

You can use HTML colspan and rowspan attributes on cells for advanced layout. </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
!colspan="6"|<translate nowrap><!--T:120--> Shopping List</translate>
|-
|rowspan="2"|<translate nowrap><!--T:121--> Bread & Butter</translate>
|<translate nowrap><!--T:122--> Pie</translate>
|<translate nowrap><!--T:123--> Buns</translate>
|<translate nowrap><!--T:124--> Danish</translate>
|colspan="2"|<translate nowrap><!--T:125--> Croissant</translate>
|-
|<translate nowrap><!--T:126--> Cheese</translate>
|colspan="2"|<translate nowrap><!--T:127--> Ice cream</translate>
|<translate nowrap><!--T:128--> Butter</translate>
|<translate nowrap><!--T:129--> Yogurt</translate>
|}
<translate> Shopping List</translate>
<translate> Bread & Butter</translate> <translate> Pie</translate> <translate> Buns</translate> <translate> Danish</translate> <translate> Croissant</translate>
<translate> Cheese</translate> <translate> Ice cream</translate> <translate> Butter</translate> <translate> Yogurt</translate>

<translate>

HTML attributes[edit source]

</translate> <translate> You can add HTML attributes to tables.</translate> <translate> For the authoritative source on HTML attributes, see [<tvar|url>https://www.w3.org/TR/html401/struct/tables.html</> the W3C's HTML Specification page on tables].</translate>

<translate>

Attributes on tables[edit source]

Placing attributes after the table start tag ({|) applies attributes to the entire table.</translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable" style="text-align: center; color: green;"
|<translate nowrap><!--T:147--> Orange</translate>
|<translate nowrap><!--T:148--> Apple</translate>
|12,333.00
|-
|<translate nowrap><!--T:149--> Bread</translate>
|<translate nowrap><!--T:150--> Pie</translate>
|500.00
|-
|<translate nowrap><!--T:151--> Butter</translate>
|<translate nowrap><!--T:152--> Ice cream</translate>
|1.00
|}
<translate> Orange</translate> <translate> Apple</translate> 12,333.00
<translate> Bread</translate> <translate> Pie</translate> 500.00
<translate> Butter</translate> <translate> Ice cream</translate> 1.00

<translate>

Attributes on cells[edit source]

</translate> <translate> You can put attributes on individual cells.</translate> <translate> For example, numbers may look better aligned right.</translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
| <translate nowrap><!--T:164--> Orange</translate>
| <translate nowrap><!--T:165--> Apple</translate>
| style="text-align:right;" | 12,333.00
|-
| <translate nowrap><!--T:166--> Bread</translate>
| <translate nowrap><!--T:167--> Pie</translate>
| style="text-align:right;" | 500.00
|-
| <translate nowrap><!--T:168--> Butter</translate>
| <translate nowrap><!--T:169--> Ice cream</translate>
| style="text-align:right;" | 1.00
|}
<translate> Orange</translate> <translate> Apple</translate> 12,333.00
<translate> Bread</translate> <translate> Pie</translate> 500.00
<translate> Butter</translate> <translate> Ice cream</translate> 1.00

<translate> You can also use cell attributes when you are listing multiple cells on a single line.</translate> <translate> Note that the cells are separated by ||, and within each cell the attribute(s) and value are separated by |.</translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
| <translate nowrap><!--T:180--> Orange</translate> || <translate nowrap><!--T:373--> Apple</translate>     || style="text-align:right;" | 12,333.00
|-
| <translate nowrap><!--T:181--> Bread</translate> || <translate nowrap><!--T:374--> Pie</translate>       || style="text-align:right;" | 500.00
|-
| <translate nowrap><!--T:182--> Butter</translate> || <translate nowrap><!--T:375--> Ice cream</translate> || style="text-align:right;" | 1.00
|}
<translate> Orange</translate> <translate> Apple</translate> 12,333.00
<translate> Bread</translate> <translate> Pie</translate> 500.00
<translate> Butter</translate> <translate> Ice cream</translate> 1.00

<translate>

Attributes on rows[edit source]

You can put attributes on individual rows, too. </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
| <translate nowrap><!--T:190--> Orange</translate>
| <translate nowrap><!--T:191--> Apple</translate>
| style="text-align:right;"| 12,333.00
|-
| <translate nowrap><!--T:192--> Bread</translate>
| <translate nowrap><!--T:193--> Pie</translate>
| style="text-align:right;"| 500.00
|- style="font-style: italic; color: green;"
| <translate nowrap><!--T:194--> Butter</translate>
| <translate nowrap><!--T:195--> Ice cream</translate>
| style="text-align:right;"| 1.00
|}
<translate> Orange</translate> <translate> Apple</translate> 12,333.00
<translate> Bread</translate> <translate> Pie</translate> 500.00
<translate> Butter</translate> <translate> Ice cream</translate> 1.00

<translate>

Attributes on caption and headers[edit source]

Attributes can be added to the caption and headers as follows. </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
|+ style="caption-side:bottom; color:#e76700;"|<translate nowrap><!--T:253--> ''Food complements''</translate>
|-
! style="color:green" | <translate nowrap><!--T:445--> Fruits</translate>
! style="color:red" | <translate nowrap><!--T:446--> Fats</translate>
|-
|<translate nowrap><!--T:254--> Orange</translate>
|<translate nowrap><!--T:258--> Butter</translate>
|-
|<translate nowrap><!--T:256--> Pear</translate>
|<translate nowrap><!--T:257--> Pie</translate>
|-
|<translate nowrap><!--T:255--> Apple</translate>
|<translate nowrap><!--T:259--> Ice cream</translate> 
|}
<translate> Food complements</translate>
<translate> Fruits</translate> <translate> Fats</translate>
<translate> Orange</translate> <translate> Butter</translate>
<translate> Pear</translate> <translate> Pie</translate>
<translate> Apple</translate> <translate> Ice cream</translate>

<translate>

Simple one-pixel table border[edit source]

An example of a one-pixel table border: </translate>

<translate> You type</translate> <translate> You get</translate>
{| border="1" style="border-collapse:collapse"
| <translate nowrap><!--T:206--> Orange</translate>
| <translate nowrap><!--T:207--> Apple</translate>
|-
| <translate nowrap><!--T:208--> Bread</translate>
| <translate nowrap><!--T:209--> Pie</translate>
|}
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>

<translate>

Border width[edit source]

If "border-width:" has only one number, it is for all four border sides: </translate>

<translate> You type</translate> <translate> You get</translate>
{|style="border-style: solid; border-width: 20px"
|
<translate nowrap><!--T:218--> Hello</translate>
|}

<translate> Hello</translate>

<translate> If "border-width:" has more than one number, the four numbers are for top, right, bottom, left (REMEMBER clockwise order <tvar|clockwise>↑→↓←</>): </translate>

<translate> You type</translate> <translate> You get</translate>
{|style="border-style: solid; border-width: 10px 20px 100px 0"
|
<translate nowrap><!--T:223--> Hello</translate>
|}

<translate> Hello</translate>

<translate>

When there are fewer than 4 values :

</translate>

  • <translate> three values i.e. <tvar|3val>top, right, bottom</>: then the default value for <tvar|left>left</> is the one of <tvar|right>right</> (second value). Width is then the same on left and right side.</translate>
  • <translate> two values i.e. <tvar|2val>top, right</>: then the default value for <tvar|bottom>bottom</> is the one of <tvar|top>top</> (first value), and <tvar|left>left</> by default is assigned the value of <tvar|right>right</> (second value). Width on top is then the same as on bottom; width on left is the same as on right.</translate>
  • <translate> one value i.e. <tvar|1val>top</>: then the default value for <tvar|right>right</> is the one of <tvar|top>top</> and it is the same for <tvar|bottom>bottom</> and <tvar|left>left</>. The fourth width are the same and build a regular border. This is a writing shortcut.</translate>

<translate> Another method to define the widths of the four sides of a cell is to use "border-left", "border-right", "border-top" and "border-bottom": </translate>

<translate> You type</translate> <translate> You get</translate>
{|style="border-left:solid 10px black;border-right:solid 20px black;border-top:solid 30px black;border-bottom:solid 40px black;" align="center" 
|
<translate nowrap><!--T:229--> Hello</translate>
|}

<translate> Hello</translate>

<span class="citation wikicite" id="endnote_ <translate> The HTML attributes (such as "width=", "border=", "cellspacing=", "cellpadding=") do not need any length unit (the pixel unit is assumed).</translate> <translate> They are also invalid in HTML 5.</translate>

<translate> "Cellpadding" is for setting the space between the cell wall and the cell content.</translate>[2]

<translate> The CSS style properties (which override the HTML attributes) require an explicit length unit (if the value is not 0) such as "px" for the pixel.</translate>">[[#ref_ <translate> The HTML attributes (such as "width=", "border=", "cellspacing=", "cellpadding=") do not need any length unit (the pixel unit is assumed).</translate> <translate> They are also invalid in HTML 5.</translate>

<translate> "Cellpadding" is for setting the space between the cell wall and the cell content.</translate>[2]

<translate> The CSS style properties (which override the HTML attributes) require an explicit length unit (if the value is not 0) such as "px" for the pixel.</translate>|^]] 

<translate>

With HTML attributes and CSS styles[edit source]

Template:Ll style attributes can be added with or without other HTML attributes. </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable" style="color:green; background-color:#ffffcc;" cellpadding="10"
|<translate nowrap><!--T:237--> Orange</translate>
|<translate nowrap><!--T:238--> Apple</translate>
|-
|<translate nowrap><!--T:239--> Bread</translate>
|<translate nowrap><!--T:240--> Pie</translate>
|-
|<translate nowrap><!--T:241--> Butter</translate>
|<translate nowrap><!--T:242--> Ice cream</translate> 
|}
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

<translate>

Padding[edit source]

</translate>

<translate> You type</translate> <translate> You get</translate>
{|class=wikitable 
| style="padding: 10px" | <translate nowrap><!--T:428--> Example of <tvar|1>style="padding:10px"</></translate>
|-
| style="padding: 50px" | <translate nowrap><!--T:429--> Example of <tvar|1>style="padding:50px"</></translate><br/><br/><translate nowrap><!--T:430--> Specify the padding on '''EACH CELL'''</translate>
|-
| style="padding:100px" | <translate nowrap><!--T:431--> Example of <tvar|1>style="padding:100px"</></translate>
|}
<translate> Example of <tvar|1>style="padding:10px"</></translate>
<translate> Example of <tvar|1>style="padding:50px"</></translate>

<translate> Specify the padding on EACH CELL</translate>
<translate> Example of <tvar|1>style="padding:100px"</></translate>

<translate>

Column width[edit source]

Column width can be added as follows.

You type: </translate>

{| class="wikitable" style="width: 85%;"
| colspan="2" | <translate nowrap><!--T:270--> This column width is 85% of the screen width</translate>
|-
| style="width: 30%"| <translate nowrap><!--T:271--> '''This column is 30% counted from 85% of the screen width'''</translate>
| style="width: 70%"| <translate nowrap><!--T:272--> '''This column is 70% counted from 85% of the screen width'''</translate>
|}

<translate> You get:</translate>

<translate> This column width is 85% of the screen width</translate>
<translate> This column is 30% counted from 85% of the screen width</translate> <translate> This column is 70% counted from 85% of the screen width</translate>

<translate>

Accessibility of table header cells[edit source]

</translate> <translate> Table header cells do not explicitly specify which table data cells they apply to (those on their right on the same row, or those below them on the same column).</translate> <translate> When the table is rendered in a visual 2D environment, this is usually easy to infer.</translate>

<translate> However when tables are rendered on non-visual media, you can help the browser to determine which table header cell applies to the description of any selected cell (in order to repeat its content in some accessibility helper) using a scope="row" or scope="col" attribute on table header cells.</translate> <translate> In most cases with simple tables, you'll use scope="col" on all header cells of the first row, and scope="row" on the first cell of the following rows:</translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
|-
! scope="col"| <translate nowrap><!--T:284--> Item</translate>
! scope="col"| <translate nowrap><!--T:285--> Quantity</translate>
! scope="col"| <translate nowrap><!--T:286--> Price</translate>
|-
! scope="row"| <translate nowrap><!--T:287--> Bread</translate>
| 0.3 kg
| $0.65
|-
! scope="row"| <translate nowrap><!--T:288--> Butter</translate>
| 0.125 kg
| $1.25
|-
! scope="row" colspan="2"| <translate nowrap><!--T:289--> Total</translate>
| $1.90
|}
<translate> Item</translate> <translate> Quantity</translate> <translate> Price</translate>
<translate> Bread</translate> 0.3 kg $0.65
<translate> Butter</translate> 0.125 kg $1.25
<translate> Total</translate> $1.90

<translate>

Alignment[edit source]

Table alignment[edit source]

</translate> <translate> Table alignment is achieved by using CSS.</translate> <translate> The table alignment is controlled by margins.</translate> <translate> A fixed margin on one side will make the table to be aligned to that side, if on the opposite side the margin is defined as auto.</translate> <translate> To have a table center aligned, you should set both margins to auto</translate>

<translate> For example, a right-aligned table: </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable" style="margin-left: auto; margin-right: 0px;"
| <translate nowrap><!--T:305--> Orange</translate>
| <translate nowrap><!--T:306--> Apple</translate>
|-
| <translate nowrap><!--T:307--> Bread</translate>
| <translate nowrap><!--T:308--> Pie</translate>
|-
| <translate nowrap><!--T:309--> Butter</translate>
| <translate nowrap><!--T:310--> Ice cream</translate> 
|}
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

<translate> And a center-aligned table: </translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable" style="margin: auto;"
| <translate nowrap><!--T:320--> Orange</translate>
| <translate nowrap><!--T:321--> Apple</translate>
|-
| <translate nowrap><!--T:322--> Bread</translate>
| <translate nowrap><!--T:323--> Pie</translate>
|-
| <translate nowrap><!--T:324--> Butter</translate>
| <translate nowrap><!--T:325--> Ice cream</translate> 
|}
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

<translate>

Table floating around text[edit source]

</translate> <translate> If you align a table to the right or the left side of the page, the text that comes after the table starts at the end of it, leaving an empty space around the table.</translate> <translate> You can make the text to be wrapped around the table by making the table to float around the text instead of just aligning it.</translate> <translate> This can be achieved using the float CSS attribute, which can specify where the table floats to the right side or to the left.</translate> <translate> When using float, margins doesn't control table alignment and can be used to specify the margin between the table and the surrounding text.</translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable" style="float:right; margin-left: 10px;"
| <translate nowrap><!--T:339--> Orange</translate>
| <translate nowrap><!--T:340--> Apple</translate>
|-
| <translate nowrap><!--T:341--> Bread</translate>
| <translate nowrap><!--T:342--> Pie</translate>
|-
| <translate nowrap><!--T:343--> Butter</translate>
| <translate nowrap><!--T:344--> Ice cream</translate> 
|}

Lorem ipsum dolor sit amet, consectetuer adipiscing 
elit, sed diam nonummy nibh euismod tincidunt ut 
laoreet dolore magna aliquam erat volutpat. Ut wisi 
enim ad minim veniam, quis nostrud exerci tation 
ullamcorper suscipit lobortis nisl ut aliquip ex ea 
commodo consequat. Duis autem vel eum iriure dolor 
in hendrerit in vulputate velit esse molestie consequat, 
vel illum dolore eu feugiat nulla facilisis at vero 
eros et accumsan et iusto odio dignissim qui blandit 
praesent luptatum zzril delenit augue duis dolore te 
feugait nulla facilisi.
<translate> Orange</translate> <translate> Apple</translate>
<translate> Bread</translate> <translate> Pie</translate>
<translate> Butter</translate> <translate> Ice cream</translate>

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

<translate>

Cell contents alignment[edit source]

</translate> <translate> The alignment of cell contents can be controlled with 2 different CSS properties: text-align and vertical-align.</translate> <translate> text-align can be specified at the table, row or individual cells, while vertical-align only can be specified at individual rows or cells.</translate>

<translate> You type</translate> <translate> You get</translate>
{| class="wikitable"
|- style="vertical-align:top;"
| style="height:100px; width:100px; text-align:left;" | A
| style="height:100px; width:100px; text-align:center;" | B
| style="height:100px; width:100px; text-align:right;" | C
|- style="vertical-align:middle;"
| style="height:100px; width:100px; text-align:left;" | D
| style="height:100px; width:100px; text-align:center;" | E
| style="height:100px; width:100px; text-align:right;" | F
|- style="vertical-align:bottom;"
| style="height:100px; width:100px; text-align:left;" | G
| style="height:100px; width:100px; text-align:center;" | H
| style="height:100px; width:100px; text-align:right;" | I
|}
A B C
D E F
G H I

<translate>

Caveats[edit source]

Negative numbers[edit source]

</translate> <translate> If you start a cell on a new line with a negative number with a minus sign (or a parameter that evaluates to a negative number), your table can get broken, because the characters |- will be parsed as the wiki markup for table row, not table cell.</translate> <translate> To avoid this, insert a space before the value (| -6) or use in-line cell markup (|| -6).</translate>

<translate>

CSS vs attributes[edit source]

Table borders specified through CSS rather than the border attribute will render incorrectly in a small subset of text browsers.

Common attributes for columns, column groups and row groups[edit source]

</translate> <translate> The MediaWiki syntax for tables currently offers no support for specifying common attributes for columns (with the HTML element <tvar|col><col /></>), column groups (HTML element <tvar|colgroup><colgroup></colgroup></>) and row groups (HTML elements <tvar|thead><thead></thead></>, <tvar|tbody><tbody></tbody></> and <tvar|tfoot><tfoot></tfoot></>).</translate> <translate> Those standard HTML elements are not accepted even in their HTML or XHTML syntax.</translate>

<translate> All the rows and cells (header or data) of the table are rendered within a single implicit row group (HTML element <tbody></tbody>) without any attributes or styles.

Tables and the Visual Editor (VE)[edit source]

</translate>

<translate> See also:</translate> Template:Ll

<translate> See <tvar|1>Phab: T108245: "Fully support basic table editing in the visual editor"</>.</translate> <translate> See the list of tasks. Finished tasks are struck. It can be difficult to figure out from the technical language there what exactly has been improved, or what features have been added. Please add explanatory info below.</translate>

<translate>

Can now move or delete columns and rows[edit source]

</translate> <translate> Click on a column or row header.</translate> <translate> Then click on the arrow.</translate> <translate> From the popup menu click on "Move" or "Delete".</translate>

<translate>

Insert blank row or column[edit source]

From the same popup menu click on "Insert".

Copy table from web page to Visual Editor[edit source]

</translate> <translate> It is possible to copy and paste a table from a web page directly into the Visual Editor (VE).</translate> <translate> To do so safely, use a sandbox and check the table for proper coding in wikitext source mode and proper display in the Visual Editor and in preview mode.</translate>

<translate>

See also[edit source]

  • [[<tvar|1>Special:MyLanguage/Help:Sorting#Sorting rows of a table</>|Sorting rows of a table]]

</translate>

<translate>

<translate>

Notes[edit source]

</translate>

  1. <translate> Tables can be created using either HTML table elements directly, or using wikicode formatting to define the table.</translate> <translate> HTML table elements and their use are well described on various web pages and will not be discussed here.</translate> <translate> The benefit of wikicode is that the table is constructed of character symbols which tend to make it easier to perceive the table structure in the article editing view compared to HTML table elements.</translate>
  2. HTML table cellpadding Attribute

[[Category:Help{{#translation:}}|Tables]]