<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://battleint.net/index.php?action=history&amp;feed=atom&amp;title=Template%3ATable_alignment%2Fdoc</id>
	<title>Template:Table alignment/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://battleint.net/index.php?action=history&amp;feed=atom&amp;title=Template%3ATable_alignment%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://battleint.net/index.php?title=Template:Table_alignment/doc&amp;action=history"/>
	<updated>2026-11-23T06:52:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://battleint.net/index.php?title=Template:Table_alignment/doc&amp;diff=170798&amp;oldid=prev</id>
		<title>imported&gt;Deadfire: creation</title>
		<link rel="alternate" type="text/html" href="https://battleint.net/index.php?title=Template:Table_alignment/doc&amp;diff=170798&amp;oldid=prev"/>
		<updated>2024-11-08T20:19:17Z</updated>

		<summary type="html">&lt;p&gt;creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{TemplateStyles|Template:Table alignment/tables.css}}&lt;br /&gt;
&lt;br /&gt;
== Purpose ==&lt;br /&gt;
To make it simpler to align the columns in tables with less wikicode.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Place &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Table alignment}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; just before the table and then add some classes to the table.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! classname&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;defaultleft&amp;lt;/code&amp;gt; || Align all table cells left by default&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;defaultcenter&amp;lt;/code&amp;gt; || Align all table cells center by default&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;defaultright&amp;lt;/code&amp;gt; || Align all table cells right by default&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;col&amp;#039;&amp;#039;N&amp;#039;&amp;#039;left&amp;lt;/code&amp;gt; || Align the cells in column &amp;#039;&amp;#039;N&amp;#039;&amp;#039; left, where N is a number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;col&amp;#039;&amp;#039;N&amp;#039;&amp;#039;center&amp;lt;/code&amp;gt; || Align the cells in column &amp;#039;&amp;#039;N&amp;#039;&amp;#039; center, where N is a number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;col&amp;#039;&amp;#039;N&amp;#039;&amp;#039;right&amp;lt;/code&amp;gt; || Align the cells in column &amp;#039;&amp;#039;N&amp;#039;&amp;#039; right, where N is a number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
With the wikitable class the header cell content is always centered unless individually adjusted.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;col&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;default&amp;#039;&amp;#039;&amp;#039; classes never affect the header cells (column, row, or anywhere) if the wikitable class is used. The &amp;#039;&amp;#039;&amp;#039;col&amp;#039;&amp;#039;&amp;#039; class overrides the &amp;#039;&amp;#039;&amp;#039;default&amp;#039;&amp;#039;&amp;#039; class.&lt;br /&gt;
&lt;br /&gt;
If the wikitable class is not used, then &amp;#039;&amp;#039;&amp;#039;col&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;default&amp;#039;&amp;#039;&amp;#039; affect header cells.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
* Column numbers up to &amp;lt;code&amp;gt;col29&amp;lt;/code&amp;gt; are supported. A table can have more columns but they cannot be aligned with this method.&lt;br /&gt;
* On tables using &amp;lt;code&amp;gt;rowspan&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;colspan&amp;lt;/code&amp;gt;, using the classes may not work well on those rows because the alignment appears in wrong cells. Normal table code like {{nowrap|1=&amp;lt;code&amp;gt;style=&amp;quot;text-align: left/center/right;&amp;quot;{{!}} &amp;#039;&amp;#039;cell content&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;}} can be added to individual cells, both to get the wanted alignment and override unwanted alignment.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:inline-table; vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{Table alignment}}&lt;br /&gt;
{| class=&amp;quot;wikitable defaultcenter col1left col4right&amp;quot;&lt;br /&gt;
!Item1&lt;br /&gt;
!Item2&lt;br /&gt;
!Item3&lt;br /&gt;
!Item4&lt;br /&gt;
|-&lt;br /&gt;
|AAAAAA&lt;br /&gt;
|100-200&lt;br /&gt;
|3-4&lt;br /&gt;
|53.43&lt;br /&gt;
|-&lt;br /&gt;
|BBB&lt;br /&gt;
|5-6&lt;br /&gt;
|7-8&lt;br /&gt;
|5563.35&lt;br /&gt;
|-&lt;br /&gt;
|CC&lt;br /&gt;
|9-10&lt;br /&gt;
|113-125&lt;br /&gt;
|322313.00&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:inline-table; vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
{{Table alignment}}&lt;br /&gt;
{| class=&amp;quot;wikitable defaultcenter col1left col4right&amp;quot;&lt;br /&gt;
!Item1&lt;br /&gt;
!Item2&lt;br /&gt;
!Item3&lt;br /&gt;
!Item4&lt;br /&gt;
|-&lt;br /&gt;
|AAAAAA&lt;br /&gt;
|100-200&lt;br /&gt;
|3-4&lt;br /&gt;
|53.43&lt;br /&gt;
|-&lt;br /&gt;
|BBB&lt;br /&gt;
|5-6&lt;br /&gt;
|7-8&lt;br /&gt;
|5563.35&lt;br /&gt;
|-&lt;br /&gt;
|CC&lt;br /&gt;
|9-10&lt;br /&gt;
|113-125&lt;br /&gt;
|322313.00&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* {{t|shy}} – Can be used to help narrow columns by adding a [[w:soft hyphen|soft hyphen]] to a word to allow it to wrap.&lt;br /&gt;
More [[w:WP:template styles|template styles]] for tables:&lt;br /&gt;
* {{t|sticky header}} - Makes column headers stick to the top of the page while scrolling through table data. &lt;br /&gt;
* {{t|sort under}} - moves the sorting arrows under the headers.&lt;br /&gt;
* {{t|row hover highlight}} - adds row hover highlighting, and option for white background. &lt;br /&gt;
* {{t|static row numbers}} - adds a column of row numbers to a table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line --&amp;gt;&lt;br /&gt;
[[Category:Table templates]]&lt;br /&gt;
[[Category:Templates using TemplateStyles to style external elements]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Deadfire</name></author>
	</entry>
</feed>