This is a header cell | This is a header cell |
---|---|
This is a left aligned cell | This is a center aligned cell |
This is a right aligned cell | Left aligned |
Center aligned | Right aligned |
Code:
[TABLE][TR][TH]This is a header cell[/TH][TH]This is a header cell[/TH][/TR][TR1][TD]This is a left aligned cell[/TD][TD1]This is a center aligned cell[/TD1][/TR1][TR2][TD2]This is a right aligned cell[/TD2][TD]Left aligned[/TD][/TR2][TR1][TD1]Center aligned[/TD1][TD2]Right aligned[/TD2][/TR1][/TABLE]
Only 'trick' is you have to put everything on a single line for parsing, so that there are no carriage returns. So my example above works, but the one below (nicely formatted) does not:
Code:
[TABLE]
[TR][TH]This is a header cell[/TH][TH]This is a header cell[/TH][/TR]
[TR1][TD]This is a left aligned cell[/TD][TD1]This is a center aligned cell[/TD1][/TR1]
[TR2][TD2]This is a right aligned cell[/TD2][TD]Left aligned[/TD][/TR2]
[TR1][TD1]Center aligned[/TD1][TD2]Right aligned[/TD2][/TR1]
[/TABLE]
Of course you could just type it out as you please (organized like the bottom) and use backspace to turn it into a single line, but if something breaks with it, expect a line break somewhere.
This is a simple (and that's not at all a bad thing) implementation.
Another good/functional example:
Header1 | Header2 | Header3 |
---|---|---|
A1 | A2 | A3 |
B1 | B2 | B3 |
C1 | C2 | C3 |
D1 | D2 | D3 |
Code:
[TABLE][TR][TH]Header1[/TH][TH]Header2[/TH][TH]Header3[/TH][/TR][TR1][TD1]A1[/TD1][TD1]A2[/TD1][TD1]A3[/TD1][/TR1][TR2][TD1]B1[/TD1][TD1]B2[/TD1][TD1]B3[/TD1][/TR2][TR1][TD1]C1[/TD1][TD1]C2[/TD1][TD1]C3[/TD1][/TR1][TR2][TD1]D1[/TD1][TD1]D2[/TD1][TD1]D3[/TD1][/TR2][/TABLE]
So in your TRs you have three options:
TR = standard background
TR1 = light background
TR2 = darker background
And in TDs three as well:
TD = left justified
TD1 = center justified
TD2 = right justified
Other BBCodes are valid inside the table, and if you fail to close a column, row, or the table itself it will do that for you.