Help:Table: Difference between revisions
→for whole columns: text-align classes for columns expanded up to (left|center|right)-12 |
→for whole columns: example added |
||
| Line 159: | Line 159: | ||
Add a the appropriate class(es) to the <code>class="wikitable"</code> statement at beginning of the table. Their name starts with the alignment specification (<code>left</code>, <code>center</code>, or <code>right</code>) and a number (1 to 12) after a minus sign (<code>-</code>). | Add a the appropriate class(es) to the <code>class="wikitable"</code> statement at beginning of the table. Their name starts with the alignment specification (<code>left</code>, <code>center</code>, or <code>right</code>) and a number (1 to 12) after a minus sign (<code>-</code>). | ||
To make the first column left-aligned, the second center-aligned, and the third right-aligned, add the classes <code>"left-1"</code>, <code>"center-2"</code>, and <code>"right-3"</code> to the <code>"wikitable"</code> class, separated by spaces: | |||
<nowiki>{| class="wikitable left-1 center-2 right-3" | |||
|- | |||
! Left-aligned | |||
! Center-aligned | |||
! Right-aligned | |||
|- | |||
| Word | |||
| 3/2 | |||
| 0.234 | |||
|- | |||
| More words | |||
| 129/128 | |||
| 123.456 | |||
|} | |||
</nowiki> | |||
{| class="wikitable left-1 center-2 right-3" | |||
|- | |||
! Left-aligned | |||
! Center-aligned | |||
! Right-aligned | |||
|- | |||
| Word | |||
| 3/2 | |||
| 0.234 | |||
|- | |||
| More words | |||
| 129/128 | |||
| 123.456 | |||
|} | |||
If you want to override the default text alignment (which is left) for the whole table, use <code>"center-all"</code> or <code>"right-all"</code>. | |||
==== for single cells ==== | ==== for single cells ==== | ||