Welcome to Wars Wiki!
Welcome to Wars Wiki. Please log in or create an account to make changes.

User:Moydow/Sandbox: Difference between revisions

From Wars Wiki
Jump to navigationJump to search
(→‎Simple tables: done for now)
 
Line 120: Line 120:
| Cell C
| Cell C
|}
|}
|}
== colspan and rowspan: Irregular-sized cells ==
One cell can be made to span several rows or columns, by using the <nowiki>colspan</nowiki> and <nowiki>rowspan</nowiki> attributes. This has various useful applications. However, the fact that these attributes eliminate certain cells from other parts of the table's coding can significantly increase the overall complexity of the table. Using the [[Wars Wiki:Sandbox|Sandbox]] and the "Show preview" button to learn how these attributes affect a table's appearance is extremely helpful. The attributes accept a numerical value representing the number of rows or columns a single cell should span. This value should be no less than two, and no greater than the total number of rows or columns in the table. The attributes are added to a cell before the cell's actual content, separated from it by a pipe symbol (|), as follows:
<pre>|colspan="2"|Cell content</pre>.
An example of a table using <nowiki>colspan</nowiki>:
<pre>{| class="wikitable"
! Header 1
! Header 2
! Header 3
|-
|colspan="2"|Cell 1+Cell 2
| Cell 3
|}</pre>
{| class="wikitable"
! Header 1
! Header 2
! Header 3
|-
|colspan="2"|Cell 1+Cell 2
| Cell 3
|}
<nowiki>rowspan</nowiki> is more difficult to code:
<pre>{| class="wikitable"
!rowspan="2"|Header 1+Cell 1
! Header 2
! Header 3
|-
| Cell 2
| Cell 3
|}</pre>
{| class="wikitable"
!rowspan="2"|Header 1+Cell 1
! Header 2
! Header 3
|-
| Cell 2
| Cell 3
|}
|}