Jump to content

Template:Table alignment/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by WOSlinker (talk | contribs) at 07:24, 30 August 2022 (Created page with '{{Documentation subpage}} {{TemplateStyles|Template:Table alignment/table.css}} == Purpose == To make it simpler to align the columns in tables with less wikicode. == Usage == Place <code><nowiki>{{Table alignment}}</nowiki></code> just before the table and then add some classes to the table. {| class="wikitable" ! classname ! Purpose |- | <code>defaultleft</code> || Align all table cells left by default |- | <code>defaultcenter</code> || Align all table...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Purpose

To make it simpler to align the columns in tables with less wikicode.

Usage

Place {{Table alignment}} just before the table and then add some classes to the table.

classname Purpose
defaultleft Align all table cells left by default
defaultcenter Align all table cells center by default
defaultright Align all table cells right by default
colNleft Align the cells in column N left, where N is a number
colNcenter Align the cells in column N center, where N is a number
colNright Align the cells in column N right, where N is a number

Limitations

On tables using colspan, using the classes may not work well on those rows and adding additional style may be needed.

Example

{{User:WOSlinker/table alignment}}
{| class="wikitable defaultcenter col1left col4right"
...
|}
Item1 Item2 Item3 Item4
AAAAAA 100-200 3-4 53.43
BBB 5-6 7-8 5563.35
CC 9-10 113-125 322313.00