Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help using our Wiki
Stationery Wiki
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Help:Introduction to tables with Wiki Markup
Help page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
Refresh
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
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.
Anti-spam check. Do
not
fill this in!
The markup for a basic table is: <pre style="width:50%"> {| class="wikitable" |- ! Header C1 ! Header C2 ! Header C3 |- | R1C1 | R1C2 | R1C3 |- | R2C1 | R2C2 | R2C3 |} </pre> This would produce: {| class="wikitable" |- ! Header C1 ! Header C2 ! Header C3 |- | R1C1 | R1C2 | R1C3 |- | R2C1 | R2C2 | R2C3 |} As you can see, columns headers are created by <code>! column name</code>. Cells are created by <code>| cell text</code>. The divider between rows is <code>|-</code>. You can add an extra column by just sticking <code>! new column name</code> at the end of the last column name. To fill the cells in that column, you need to add another cell to each row: fill it by typing <code>| cell text</code>. If you want to add an extra row, just add <code>|-</code> to the table, and fill it with however many cells are appropriate. To recap, the markup is: {| class="wikitable" | <nowiki />{| | '''table start:''' ''required!'' |- | <nowiki />|+ | '''table caption:''' ''optional.'' Only between '''table start''' and '''first table row''' |- | <nowiki />! | '''table header cell:''' ''optional.'' Consecutive cells may be added on same lines separated by double marks (<code>!!</code>); or start on new lines, each beginning with its own single mark (<code>!</code>). |- | <nowiki />|- | '''table row''': ''optional on first row, otherwise required''. The wiki engine assumes the first row. |- | <nowiki />| | '''table data cell''': ''required!'' Consecutive cells may be added on same lines separated by double marks (<code><nowiki>||</nowiki></code>); or start on new lines, each beginning with its own single mark (<code><nowiki>|</nowiki></code>). Single marks are also used to separate HTML attributes from cell contents (both data or header), or caption contents. |- | <nowiki />|} | '''table end:''' ''required!'' |} * Blank spaces at the beginning of a line are ignored. * Escaping to insert a pipe (<code>|</code>) character into a table can be done using the {{xtag|nowiki}} markup. * <code>class="wikitable"</code> is used with a lot of tables on Wikipedia, and adds some standard formatting. ===Using <code>||</code> and <code>!!</code> with tables=== The above markup must start on a new line. This includes the cell markup (<code>|</code> and <code>!</code>). But the double cell markup (<code>||</code> and <code>!!</code>) can optionally be used for adding consecutive cells to a single line. For example, this would produce the same table as above: <pre style="width:60%"> {| class="wikitable" |- ! Header C1 !! Header C2 !! Header C3 |- | R1C1 || R1C2 || R1C3 |- | R2C1 || R2C2 || R2C3 |} </pre> [[Category:stationery.wiki quick introductions]] [[Category:stationery.wiki tables]]
Summary:
Please note that all contributions to Stationery Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Stationery Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Xtag
(
edit
)