Help:Table: Difference between revisions

Fredg999 category edits (talk | contribs)
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 ====
==== 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 ====
==== 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 want for the cell
! what you do to get it
! What you do to get it
|-
|-
| left aligned text
| 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>
| 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;" | centered text
| style="text-align:center;" | Centered text
| place <code><nowiki>style="text-align:center;" |</nowiki></code> after the opening pipe
| Place <code>style{{=}}"text-align: center;" {{pipe}}</code> after the opening pipe
|-
|-
| style="text-align:right;" | right aligned
| style="text-align:right;" | Right aligned
| place <code><nowiki>style="text-align:center;" |</nowiki></code> after the opening pipe
| Place <code>style{{=}}"text-align: center;" {{pipe}}</code> after the opening pipe
|-
|-
! headline style
! Headline style
| exclamation mark instead of the pipe symbol starts the cell
| Exclamation mark instead of the pipe symbol starts the cell
|}
|}