Help:Editing: Difference between revisions

more table help
(might as well start a section on tables *grumbles*)
(more table help)
Line 145: Line 145:
Normally we apply the class "wikitable" to a table to give it borders and make it look pretty with <code>{| class="wikitable"</code>, though you can do a lot of manual styling for almost any custom look you want (see {{SectionLink||Further help}} to read more about tables).
Normally we apply the class "wikitable" to a table to give it borders and make it look pretty with <code>{| class="wikitable"</code>, though you can do a lot of manual styling for almost any custom look you want (see {{SectionLink||Further help}} to read more about tables).


To make the table a fixed width, add this CSS styling to the first line: <code>{| style="width:500px;"</code>. You can also use a percentage such as <code>width:50%;</code>. To center the table on the page, use <code>{| style="margin-left:auto; margin-right:auto;"</code>.
To make the table a fixed width, add this CSS styling to the first line: <code>{| style="width:500px;"</code>. You can also use a percentage such as <code>width:50%;</code>. To center the table on the page, use <code>{| style="margin-left:auto; margin-right:auto;"</code>. To right-align it, use <code>"float:right;"</code> instead.
 
You can add styling directives to individual columns, rows and cells like this:
 
<pre>
{| class="wikitable"
!width="200"|Column 1
!Column 2
|- style="font-size:75%;"
|R1C1
|R1C2
|-
|colspan="2" align="center" style="height:40px; background:DarkSeaGreen;" valign="top"|R2C1&2
|}</pre>
 
…which yields:
 
{| class="wikitable"
!width="200"|Column 1
!Column 2
|- style="font-size:75%;"
|R1C1
|R1C2
|-
|colspan="2" align="center" style="height:40px; background:DarkSeaGreen;" valign="top"|R2C1&2
|}


For more advanced table markup, see below.
For more advanced table markup, see below.