Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in or
create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision |
Your text |
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
| |
| |} | | |} |