2022-05-14 12:31:36 +00:00
caption: Tables
2013-12-05 16:21:10 +00:00
created: 20130914132100000
2022-11-23 21:52:36 +00:00
modified: 20220819103416274
2014-09-11 08:15:58 +00:00
tags: WikiText
2013-12-05 16:21:10 +00:00
title: Tables in WikiText
type: text/vnd.tiddlywiki
2013-09-14 14:06:16 +00:00
! Basics
2022-05-14 12:31:36 +00:00
TiddlyWiki5 formats tables using vertical bar `|` characters. Exclamation marks `!` are used to indicate header cells.
2013-09-14 14:06:16 +00:00
2022-05-14 12:31:36 +00:00
<<wikitext-example-without-html src:"""|!Cell1 |!Cell2 |
2013-09-14 14:06:16 +00:00
|Cell3 |Cell3 |
2022-05-14 12:31:36 +00:00
""">>
2013-09-14 14:06:16 +00:00
! Cell Alignment
Table cell alignment is controlled by inserting space characters before and/or after the cell content. For example:
2022-05-14 12:31:36 +00:00
<<wikitext-example-without-html src:"""|Left aligned content |
2013-09-14 14:06:16 +00:00
| Right aligned content|
| Centred content |
|+++ a very wide column so we can see the alignment +++|
2022-05-14 12:31:36 +00:00
""">>
2013-09-14 14:06:16 +00:00
2014-01-03 10:39:55 +00:00
! Cell vertical Alignment
2014-01-25 14:47:25 +00:00
Vertical alignment of cells is done by inserting either a `^` for top alignment or a `,` for bottom alignment as the first character of a cell. The normal horizontal alignment is still possible. For example:
2014-01-03 10:39:55 +00:00
```
|^top left |^ top center |^ top right|
|middle left | middle center | middle right|
|,bottom left |, bottom center |, bottom right|
```
The example renders as:
| :: | ::::::::::::::::::::::::::: | ::::::::::::::::::::::::::: | ::::::::::::::::::::::::::: | :: |
| ::<br>:: |^top left |^ top center |^ top right| ::<br>:: |
| ::<br>:: |middle left | middle center | middle right| ::<br>:: |
| ::<br>:: |,bottom left |, bottom center |, bottom right| ::<br>:: |
| :: | ::::::::::::::::::::::::::: | ::::::::::::::::::::::::::: | ::::::::::::::::::::::::::: | :: |
2014-01-25 14:47:25 +00:00
If you need to have a `^`or a `,` as the first character of a left aligned cell, you can use HTML escaping:
2014-01-03 10:39:55 +00:00
| `^` | &#94; |
| `,` | &#44; |
2022-05-14 12:31:36 +00:00
2013-09-14 14:06:16 +00:00
! Cell Merging
2014-01-03 10:39:55 +00:00
To merge a table cell with the one above, use the special cell text `~`. To merge a cell with the one to its left use the text `<`. To merge one to its right use `>`. For example:
2013-09-14 14:06:16 +00:00
2022-05-14 12:31:36 +00:00
<<wikitext-example-without-html src:"""|Cell1 |Cell2 |Cell3 |Cell4 |
2014-01-03 10:39:55 +00:00
|Cell5 |Cell6 |Cell7 |<|
2013-09-14 14:06:16 +00:00
|Cell5 |~|Cell7 |Cell8 |
2014-01-03 10:39:55 +00:00
|>|Cell9 |Cell10 |Cell11 |
2022-05-14 12:31:36 +00:00
""">>
2013-09-14 14:06:16 +00:00
! Table Classes, Captions, Headers and Footers
2022-11-23 21:52:36 +00:00
{{Table Classes, Captions, Headers and Footers}}
2014-09-19 11:45:49 +00:00
2013-09-14 14:06:16 +00:00
2022-11-23 21:52:36 +00:00
More examples can be found at: [[Tables in WikiText CSS Utility Classes]]