Help:Table: Difference between revisions

ArrowHead294 (talk | contribs)
Overthink (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Wikipedia}}
Tables can be used to layout contents horizontally and vertically. Tables can be made sortable, columns may be aligned, cells may be combined. See the following examples.
Tables can be used to layout contents horizontally and vertically. Tables can be made sortable, columns may be aligned, cells may be combined. See the following examples.


Line 115: Line 116:
|-
|-
| 6  || 200 || Debussy loves it.
| 6  || 200 || Debussy loves it.
|}</nowiki>
|}</pre>


{| class="wikitable sortable"
{| class="wikitable sortable"
Line 214: Line 215:
|-
|-
| 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, and use <code>style{{=}}"text-align: left;" {{pipe}}</code></ref>
|-
|-
| style="text-align:center;" | Centered text
| style="text-align:center;" | Centered text
Line 220: Line 221:
|-
|-
| style="text-align:right;" | Right aligned
| style="text-align:right;" | Right aligned
| Place <code>style{{=}}"text-align: center;" {{pipe}}</code> after the opening pipe
| Place <code>style{{=}}"text-align: right;" {{pipe}}</code> after the opening pipe
|-
|-
! Headline style
! Headline style
Line 235: Line 236:


{| class="wikitable"
{| class="wikitable"
|+ Compact syntax: one line per row
|+ style="font-size: 105%;" | Compact syntax: one line per row
|-
|-
! Wikitext
! Wikitext
Line 257: Line 258:


{| class="wikitable"
{| class="wikitable"
|+ "Airy" syntax: one line per cell
|+ style="font-size: 105%;" | "Airy" syntax: one line per cell
|-
|-
! Wikitext
! Wikitext
Line 264: Line 265:
| <pre>
| <pre>
{| class="wikitable"
{| class="wikitable"
|-
!| A|X
!| A|X
!| B|Y
!| B|Y
Line 272: Line 274:
</pre>
</pre>
| {{(!}} class{{=}}"wikitable" style{{=}}"margin: auto auto auto auto;"
| {{(!}} class{{=}}"wikitable" style{{=}}"margin: auto auto auto auto;"
{{!-}}
!{{!}} A{{!}}X
!{{!}} A{{!}}X
!{{!}} B{{!}}Y
!{{!}} B{{!}}Y
Line 280: Line 283:
|}
|}


Alternatively, pipe characters can be escaped using {{tlx|!}} or {{tlx|pipe}}.
Alternatively, pipe characters can be escaped using {{tlx|!}} or {{tlx|pipe}}:
 
{| class="wikitable"
|+ style="font-size: 105%;" | Using escapes
|-
! Wikitext
! Rendered output
|-
| <pre>
{| class="wikitable"
|-
! A{{pipe}}X
! B{{pipe}}Y
|-
| 1{{pipe}}2
| 3{{pipe}}4
|}
</pre>
| {{(!}} class{{=}}"wikitable" style{{=}}"margin: auto auto auto auto;"
{{!-}}
! A{{pipe}}X
! B{{pipe}}Y
{{!-}}
{{!}} 1{{pipe}}2
{{!}} 3{{pipe}}4
{{!)}}
|}


== Combining table cells ==
== Combining table cells ==