Table: Difference between revisions From Online Manual

Jump to: navigation, search
(remove <nowiki> from example; categorize basic as per http://docs.simplemachines.org/index.php?topic=57)
(Rewrite based on a post by Chas Large)
Line 1: Line 1:
<tr><td><center><span style="font-size: 12pt;" class="bbc_size"><tt>'''table'''</tt></span></center></td><td><center>'''Table'''</center></td><td><center><img src="http://docs.simplemachines.org/Themes/default/images/bbc/table.gif" alt="" class="bbc_img" /></center></td></tr>
A table organises one or more lines of text into columns. It does this by organising the text into table rows and, within each row, table data. Text is placed inside the Table Data tags to create the table.


<tr><td>&#91;table&#93;&#91;/table&#93;</td><td>The <tt>table</tt> tags, along with the <tt>tr</tt> and <tt>td</tt> tags are used to produce tables. These three tags correspond to their html equivalents, however there are fewer options in the BB Codes. The table by itself does not produce any visible output. This is a block level tag, however it can only contain <tt>tr</tt> tags.</td><td></td></tr>
Although the tags are based on the html <nowiki><table>, <tr> and <td></nowiki> tags there is no further formatting possible.
 
In this example a simple 3x3 table is created. Start a new topic and click the Insert Table button [[Image:table.gif]] which adds the following code.
[table]
[tr]
[td][/td]
[/tr]
[/table]
This generates the start and end of a Table with a Table Row and Table Data inside.
 
Type two more Data tags within the Row then copy the Row down twice to end up with a table like this:
 
[table]
[tr]
[td][/td][td][/td][td][/td]
[/tr]
[tr]
[td][/td][td][/td][td][/td]
[/tr]
[tr]
[td][/td][td][/td][td][/td]
[/tr]
[/table]
 
Add text between the Data tags and you will have a formatted table:
 
[table]
[tr]
[td]R1C1[/td][td]R1C2[/td][td]R1C3[/td]
[/tr]
[tr]
[td]R2C1[/td][td]R2C2[/td][td]R2C3[/td]
[/tr]
[tr]
[td]R3C1[/td][td]R3C2[/td][td]R3C3[/td]
[/tr]
[/table]
Which displays like this.
<table>
<tr><td>R1C1</td><td>R1C2</td><td>R1C3</td></tr>
<tr><td>R2C1</td><td>R2C2</td><td>R2C3</td></tr>
<tr><td>R3C1</td><td>R3C2</td><td>R3C3</td></tr>
</table>
 
To add a bit of padding, add some blank Data tags (empty columns), this works better than just padding with spaces.
 
[table]
[tr]
[td]R1C1[/td][td][/td][td]R1C2[/td][td][/td][td]R1C3[/td]
[/tr]
[tr]
[td]R2C1[/td][td][/td][td]R2C2[/td][td][/td][td]R2C3[/td]
[/tr]
[tr]
[td]R3C1[/td][td][/td][td]R3C2[/td][td][/td][td]R3C3[/td]
[/tr]
[/table]


[[Category:Bulletin_Board_Code]]
[[Category:Bulletin_Board_Code]]
{{Cleanup html}}
[[Category:Basic Bulletin Board Code]]
[[Category:Basic Bulletin Board Code]]

Revision as of 16:08, 9 January 2011

A table organises one or more lines of text into columns. It does this by organising the text into table rows and, within each row, table data. Text is placed inside the Table Data tags to create the table.

Although the tags are based on the html <table>, <tr> and <td> tags there is no further formatting possible.

In this example a simple 3x3 table is created. Start a new topic and click the Insert Table button Table.gif which adds the following code.

[table]
[tr]
[td][/td]
[/tr]
[/table]

This generates the start and end of a Table with a Table Row and Table Data inside.

Type two more Data tags within the Row then copy the Row down twice to end up with a table like this:

[table]
[tr]
[td][/td][td][/td][td][/td]
[/tr]
[tr]
[td][/td][td][/td][td][/td]
[/tr]
[tr]
[td][/td][td][/td][td][/td]
[/tr]
[/table] 

Add text between the Data tags and you will have a formatted table:

[table]
[tr]
[td]R1C1[/td][td]R1C2[/td][td]R1C3[/td]
[/tr]
[tr]
[td]R2C1[/td][td]R2C2[/td][td]R2C3[/td]
[/tr]
[tr]
[td]R3C1[/td][td]R3C2[/td][td]R3C3[/td]
[/tr]
[/table] 

Which displays like this.

R1C1R1C2R1C3
R2C1R2C2R2C3
R3C1R3C2R3C3

To add a bit of padding, add some blank Data tags (empty columns), this works better than just padding with spaces.

[table]
[tr]
[td]R1C1[/td][td][/td][td]R1C2[/td][td][/td][td]R1C3[/td]
[/tr]
[tr]
[td]R2C1[/td][td][/td][td]R2C2[/td][td][/td][td]R2C3[/td]
[/tr]
[tr]
[td]R3C1[/td][td][/td][td]R3C2[/td][td][/td][td]R3C3[/td]
[/tr]
[/table]


Advertisement: