Help:Table: Difference between revisions
m Todo categories |
ArrowHead294 (talk | contribs) |
||
| Line 157: | Line 157: | ||
If you want to override the default text alignment for all cells, add the class <code>"center-all"</code> to the <code>class="wikitable"</code> statement at beginning of the table. | If you want to override the default text alignment for all cells, add the class <code>"center-all"</code> to the <code>class="wikitable"</code> statement at beginning of the table. | ||
==== | ==== For whole columns ==== | ||
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>). | ||
| Line 196: | Line 195: | ||
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>. | 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 ==== | ||
The table cells are left aligned by default, the heading cells are center aligned. You may change this via inline CSS style definitions: | The table cells are left aligned by default, the heading cells are center aligned. You may change this via inline CSS style definitions: | ||
{| class="wikitable" | {| class="wikitable" | ||
! | ! What you want for the cell | ||
! | ! What you do to get it | ||
|- | |- | ||
| | | Left aligned text | ||
| | | Nothing to do (if the default is "left-align", this is mostly the case)<ref>If a column has other then left-aligned text, for example by <code>class="... right-all"</code> (see above section(s)), cell-specific inline [[CSS]] will prioritized highest</ref> | ||
|- | |- | ||
| style="text-align:center;" | | | style="text-align:center;" | Centered text | ||
| | | Place <code>style{{=}}"text-align: center;" {{pipe}}</code> after the opening pipe | ||
|- | |- | ||
| style="text-align:right;" | | | style="text-align:right;" | Right aligned | ||
| | | Place <code>style{{=}}"text-align: center;" {{pipe}}</code> after the opening pipe | ||
|- | |- | ||
! | ! Headline style | ||
| | | Exclamation mark instead of the pipe symbol starts the cell | ||
|} | |} | ||