# Formatting tables with BBcode or HTML on the TT Forum



## Guest (Jan 23, 2011)

Hi.

I've been trying in vain to get tables to format properly in posts. I've tried enclosing the HTML code in the HTML tags and just using straight BBcode with the option to use it checked to no avail. Can anyone confirm if it can be done and, if so, suggest what I'm doing wrong?

Thanks in advance.

Doug
························································································································································································


----------



## Nem (Feb 14, 2005)

You can't use any HTML in posts at all.

For help with BBCode have a look here: faq.php?mode=bbcode

Can't see anything for creating tables tho :?

Nick


----------



## Guest (Jan 24, 2011)

Nem said:


> You can't use any HTML in posts at all.
> Nick


Thanks Nick, but I see a Code button on the menu that inserts the following tags:


```

```
I tried inserting BBcode for table formatting (see example below) enclosed by this and it didn't work.

http://www.teamopolis.com/tools/bbcode- ... aspx#table


Row 1 Col 1Row 1 Col 2Row 1 Col 3Row 2 Col 1Row 2 Col 2Row 2 Col 3

Thanks anyway.

Doug


----------



## Nem (Feb 14, 2005)

But the {code} tags are not to let you enter code to be executed, it's to allow you to display code which is specifically not executed. To allow you to share code so people can see the code which is being used, and not the formatted result.

Also BBCode is not the same across different forum platforms. PHPBB3 for example which we run does not have any built in BBCode for tables. As shown on the link I posted above which outlines all of the available codes which can be used.


----------



## Guest (Jan 25, 2011)

O.k., that explains it then. Thanks Nick.

Doug


----------



## John-H (Jul 13, 2005)

I've always had to add . . . . . between entries in columns to space things out. You can make the dots invisible by matching them white to the background colour like this in the last two lines:

Test 1 . . . . . Test 2 . . . . . Test 3 . . . . . Test 4
. . 1 . . . . . . . . 2 . . . . . . . . 3 . . . . . . . . . 4
. . 1 . . . . . . . . 2 . . . . . . . . 3 . . . . . . . . . 4
. . 1 . . . . . . . . 2 . . . . . . . . 3 . . . . . . . . . 4

Strangely, there's a difference between preview and the actual post!

Alternatively, do it on a spreadsheet and host the image. All messy but where there's a will . . . :wink:


----------



## Guest (Jan 26, 2011)

Many thanks for the clever and pragmatic suggestion John.

EDIT: 13th Feb. Please see attached MS Excel 2003 spreadsheet with some VBA code to allow you to achieve this using spaces as the spacing characters thus avoiding the need to make the dots white which requires precious characters. I looked on the internet for clever ways to do it, but there isn't, so the spaced rows must have their width autofitted and iterated until each one matches the width of the row with the longest string. Not elegant, but works well.

Instructions
1. Paste your table into the sheet with the header titles in row 1 (I've left an example in there).
2. Ensure the columns are formatted Left, Right or Centre as required.
3. Go to Tools, Macro, Macros and run the macro entitled Table_Formatter (there's only one).
4. Formatted output will be written to columns starting two after the last column in the original table.

A complicated example with difference coloured column entries:

RPM·········BAM (%)····BFV(%)
1000········97.0··········99.0
1720········128.1········129.8
2000········140.6········148.5
2100········147.4········154.5
2200········146.7········155.3
2520········140.8········166.5
3000········138.3········166.5
3520········140.9········166.5
4000········144.0········166.5
4520········151.8········177.0
5000········151.7········185.3
5520········157.7········171.8
5900········155.3········168.8
6000········153.0········160.5
6400········142.3········148.5
6800········130.1········144.0

This costs 2808 characters so a few of these will soon bust the 15,000 character limit on a post.

Annoyingly, the Forum ignores multiple spaces if you try to use them as 'invisible' spacer characters. 

1000 97.0 99.0
1720 128.1 129.8
2000 140.6 148.5
2100 147.4 154.5
2200 146.7 155.3
2520 140.8 166.5
3000 138.3 166.5
3520 140.9 166.5
4000 144.0 166.5
4520 151.8 177.0
5000 151.7 185.3
5520 157.7 171.8
5900 155.3 168.8
6000 153.0 160.5
6400 142.3 148.5
6800 130.1 144.0

Doug


----------

