Difference between revisions of "Help:How to make tables"

From Birocapedia
Jump to navigationJump to search
Line 47: Line 47:
 
To make the thing above I actually used a table. I made a row with a cell ''You type'' and a cell ''You get''. Then I made a new row with a cell for the box with the code in it and a cell with a table inside it (you can put tables inside tables). Using a table was the only way I could have made it look like that. Tables can give you a lot of control over your page. As you can see, the table above does not have and lines between the cells. Read on to see how you can add atributes like this to tables.
 
To make the thing above I actually used a table. I made a row with a cell ''You type'' and a cell ''You get''. Then I made a new row with a cell for the box with the code in it and a cell with a table inside it (you can put tables inside tables). Using a table was the only way I could have made it look like that. Tables can give you a lot of control over your page. As you can see, the table above does not have and lines between the cells. Read on to see how you can add atributes like this to tables.
 
==Borders==
 
==Borders==
To make borders you place a border attibute in the first line of the table after the {| like this {|border="1". You can set the number after border=" to whatever you want the size of the border to be but I would recomend using just 1 to make your table look good. You can see an example of this below. The place where the attribute is added is in red.
+
To make borders you place a border attibute in the first line of the table after the {| like this {|border="1". You can set the number after border=" to whatever you want the size of the border to be but I would recomend using just 1 to make your table look good. You can see an example of this below.
 
{|width="100%"
 
{|width="100%"
 
|-
 
|-
Line 75: Line 75:
 
|width="50%"|
 
|width="50%"|
 
{|border="1"
 
{|border="1"
 +
|-
 +
|''Cabin''
 +
|''Number of campers''
 +
|-
 +
|Cabin 1
 +
|4
 +
|-
 +
|Cabin 6
 +
|4
 +
|-
 +
|Eagle's Nest
 +
|8
 +
|-
 +
|Buzzard's Roost
 +
|8
 +
|}
 +
|}
 +
==Alignment==
 +
You can make a table appear on the right or middle of a page by using the align attribute like this: {|align="right". You can also set it to "center". If you want to make the table be in the center and have it have a border you can add multiple attributes to it like this: {|align="right" border="1". Below you can see some examples.
 +
{|width="100%"
 +
|-
 +
|width="50%"|''You type''
 +
|width="50%"|''You get''
 +
|-
 +
|width="50%"|
 +
<pre>
 +
{|align="right" border="1"
 +
|-
 +
|''Cabin''
 +
|''Number of campers''
 +
|-
 +
|Cabin 1
 +
|4
 +
|-
 +
|Cabin 6
 +
|4
 +
|-
 +
|Eagle's Nest
 +
|8
 +
|-
 +
|Buzzard's Roost
 +
|8
 +
|}
 +
</pre>
 +
|width="50%"|
 +
{|align="right" border="1"
 +
|-
 +
|''Cabin''
 +
|''Number of campers''
 +
|-
 +
|Cabin 1
 +
|4
 +
|-
 +
|Cabin 6
 +
|4
 +
|-
 +
|Eagle's Nest
 +
|8
 +
|-
 +
|Buzzard's Roost
 +
|8
 +
|}
 +
|}
 +
{|width="100%"
 +
|-
 +
|width="50%"|''You type''
 +
|width="50%"|''You get''
 +
|-
 +
|width="50%"|
 +
<pre>
 +
{|align="center" border="1"
 +
|-
 +
|''Cabin''
 +
|''Number of campers''
 +
|-
 +
|Cabin 1
 +
|4
 +
|-
 +
|Cabin 6
 +
|4
 +
|-
 +
|Eagle's Nest
 +
|8
 +
|-
 +
|Buzzard's Roost
 +
|8
 +
|}
 +
</pre>
 +
|width="50%"|
 +
{|align="center" border="1"
 
|-
 
|-
 
|''Cabin''
 
|''Cabin''

Revision as of 00:38, 20 January 2008

Tables can help you put a lot of information in to a concentrated space. They are a little bit difficult to make so only read this if you are already farmiliar with how text formatting works. To start a table make a line with just {| and nothing else. On the next line put |- which means you are starting to put information in for the first row of the table. On the next line put a | which means you are making a cell in the row and put the contents of that cell on the rest of the line. On the next line put an other | and the contents of the second cell. Make as many cells in a row as you want using |. To start the second row put |- on the next line to signify a new row. To finish the table make a line at the end with |}. Below you can see an example of what you would type to make a table and what it makes in the article.

A simple table

You type You get
{|
|-
|''Cabin''
|''Number of campers''
|-
|Cabin 1
|4
|-
|Cabin 6
|4
|-
|Eagle's Nest
|8
|-
|Buzzard's Roost
|8
|}
Cabin Number of campers
Cabin 1 4
Cabin 6 4
Eagle's Nest 8
Buzzard's Roost 8

To make the thing above I actually used a table. I made a row with a cell You type and a cell You get. Then I made a new row with a cell for the box with the code in it and a cell with a table inside it (you can put tables inside tables). Using a table was the only way I could have made it look like that. Tables can give you a lot of control over your page. As you can see, the table above does not have and lines between the cells. Read on to see how you can add atributes like this to tables.

Borders

To make borders you place a border attibute in the first line of the table after the {| like this {|border="1". You can set the number after border=" to whatever you want the size of the border to be but I would recomend using just 1 to make your table look good. You can see an example of this below.

You type You get
{|border="1"
|- 
|''Cabin''
|''Number of campers''
|-
|Cabin 1
|4
|-
|Cabin 6
|4
|-
|Eagle's Nest
|8
|-
|Buzzard's Roost
|8
|}
Cabin Number of campers
Cabin 1 4
Cabin 6 4
Eagle's Nest 8
Buzzard's Roost 8

Alignment

You can make a table appear on the right or middle of a page by using the align attribute like this: {|align="right". You can also set it to "center". If you want to make the table be in the center and have it have a border you can add multiple attributes to it like this: {|align="right" border="1". Below you can see some examples.

You type You get
{|align="right" border="1"
|- 
|''Cabin''
|''Number of campers''
|-
|Cabin 1
|4
|-
|Cabin 6
|4
|-
|Eagle's Nest
|8
|-
|Buzzard's Roost
|8
|}
Cabin Number of campers
Cabin 1 4
Cabin 6 4
Eagle's Nest 8
Buzzard's Roost 8
You type You get
{|align="center" border="1"
|- 
|''Cabin''
|''Number of campers''
|-
|Cabin 1
|4
|-
|Cabin 6
|4
|-
|Eagle's Nest
|8
|-
|Buzzard's Roost
|8
|}
Cabin Number of campers
Cabin 1 4
Cabin 6 4
Eagle's Nest 8
Buzzard's Roost 8