User:Timeshifter/Sandbox240

More cell operations.

Help:Table

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

Wikitext

Produces

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

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

Wikitext Produces

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

Wikitext

Produces

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

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

Setting default cell padding

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

If  is not used

Wikitext

Produces

Using :

Wikitext

Produces

Using :

Wikitext

Produces

Using  and  :

Wikitext

Produces

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

Wikitext

Produces

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


 * Border styles

The  and   properties can accept the following arguments:


 * Borders of a cell using,  ,  ,

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

Produces


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

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

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

Wikitext

Produces

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

Wikitext

Produces

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

Wikitext

Produces

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

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