News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Help with BB code for tables, cells, columns

Started by joehark, February 18, 2010, 04:49:02 AM

Previous topic - Next topic

joehark

I'm blind on this. I can't see how to create a table using BB code. I'm trying to crate a BB-generated table with 3 rows and 3 columns, with sample text in each cell.  Can someone post a sample of what that would look like?

How does one control the size of a row, column or cell - or is that based on the content?

Is it possible to put 1px border around each cell?

That help will be greatly appreciated.


Chas Large

First off, click the Insert Table button this adds the following code.
[table][/table]
This generates the start and end of a Table. Into this you need to add Table Rows and then Table Data.
Place your cursor between the Table tags and click the Table Row button
You should now have:
[table][tr][/tr][/table]
Then between the Table Row tags tr Add the Table Data tags by clicking the Table Column button
Giving you:
[table][tr][td][/td][/tr][/table]
Move the /table tag down a few lines then add the Data tags twice more within the Row then copy the Row down a few times 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]

All you need do now is add the text between the Data tags and you should end up with a nicely formatted table:
[table]
[tr][td]R1 C1[/td][td]R1 C2[/td][td]R1 C3[/td][/tr]
[tr][td]R2 C1[/td][td]R2 C2[/td][td]R2 C3[/td][/tr]
[tr][td]R3 C1[/td][td]R3 C2[/td][td]R3 C3[/td][/tr]
[/table]

Which displays like this.

R1 C1R1 C2R1 C3
R2 C1R2 C2R2 C3
R3 C1R3 C2R3 C3
To add a bit of padding, add some blank Data tags (empty columns), this works better than just padding with spaces.
[table]
[tr][td]R1 C1[/td][td][/td][td]R1 C2[/td][td][/td][td]R1 C3[/td][/tr]
[tr][td]R2 C1[/td][td][/td][td]R2 C2[/td][td][/td][td]R2 C3[/td][/tr]
[tr][td]R3 C1[/td][td][/td][td]R3 C2[/td][td][/td][td]R3 C3[/td][/tr]
[/table]

Which results in:

R1 C1R1 C2R1 C3
R2 C1R2 C2R2 C3
R3 C1R3 C2R3 C3

There's a good tutorial on HTML Tables HERE
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

joehark

That is one of the finest explanations I have ever gotten from a support forum, and I've been to many, of every kind, from shopping carts to blogs. You demonstrate that you are one of the few people who understand the concept of answering these kinds of questions.

I am sincerely grateful.

Chas Large

You're very welcome, thanks for the compliment :)
Chas
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Advertisement: