Tables: HTML to Wiki Markup

From burstekwiki
Jump to: navigation, search

Comparison of table syntax

XHTML Wiki-pipe
Table
<table></table>
{|
|}
Caption
<caption>caption</caption>
|+ caption
Row
<tr></tr>
|-
Data cell
<td>cell1</td><td>cell2</td>
<td>cell3</td>
| cell1 || cell2
| cell3
Header cell
<th scope="col">column heading</th>
<th scope="row">row heading</th>
! scope="col" | column heading
! scope="row" | row heading
Sample table
1 2
3 4
<table>
 <tr>
 <td>1</td>
 <td>2</td>
 </tr>
 <tr>
 <td>3</td>
 <td>4</td>
 </tr>
</table>
{|
| 1 || 2
|-
| 3 || 4
|}
Pros
  • Can preview or debug with any XHTML editor
  • Can be indented for easier reading
  • Well-known
  • Insensitive to newlines
  • No characters like "|" which can collide with template and parser function syntax
  • Easy to write
  • Easy to read
  • Takes little space
  • Can be learned quickly
Cons
  • Tedious
  • Takes a lot of space
  • Difficult to read quickly
  • Debugging more difficult due to tag pairing requirements
  • Indented code might not match nesting.
  • Confusing newline behaviour as they only occasionally break cells.
  • Unfamiliar syntax for experienced HTML editors
  • Rigid structure
  • Cannot be indented for clarity
  • HTML tag text may be easier to read than pipes, plus signs, dashes, etc.
  • Requires using Template:! to pass a "|" in a parameter.
  • Sensitive to newlines; see Help:Newlines and spaces.
XHTML Wiki-pipe

See http://en.wikipedia.org/wiki/Help:Table for more information

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox