Inserting tables into posts

Find our latest site news here. Want to contribute, have an idea or having a problem? Post your feedback here!
Post Reply
User avatar
archibalduk
TBL Admin Team
Posts: 19465
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Inserting tables into posts

Post by archibalduk » Mon Mar 28, 2011 9:45 pm

I have created some BBCode which allows us all to put HTML-style tables into forum posts. This is something that has been requested quite frequently over the years - and something I have personally wanted to add for a long time indeed! Thankfully the new forum software finally allows us to have such a feature.

It's pretty straightforward to add a table - and it works in the same way as HTML table code: http://www.w3schools.com/html/html_tables.asp. In other words, you start with a [table][/table] tag and then within this you add a new row using [tr] [/tr]. Within the table rows, you insert cells/columns using [td][/td]. You can also use [th][/th] instead of [td][/td] to add table header cells (this makes the text bold, etc without having to add addional [b][/b] tags).

Here's a simple example:

Code: Select all

[table]
[tr][th]		[/th][th]	Eastern Conference	[/th][th]	GP	[/th][th]	W	[/th][th]	L	[/th][th]	OTL	[/th][th]	Pts	[/th][/tr]
[tr][td]	1	[/td][td]	Philadelphia Flyers	[/td][td]	75	[/td][td]	45	[/td][td]	20	[/td][td]	10	[/td][td]	100	[/td][/tr]
[tr][td]	2	[/td][td]	Washington Capitals	[/td][td]	76	[/td][td]	44	[/td][td]	22	[/td][td]	10	[/td][td]	98	[/td][/tr]
[tr][td]	3	[/td][td]	Boston Bruins	[/td][td]	75	[/td][td]	42	[/td][td]	23	[/td][td]	10	[/td][td]	94	[/td][/tr]
[tr][td]	4	[/td][td]	Pittsburgh Penguins	[/td][td]	76	[/td][td]	45	[/td][td]	23	[/td][td]	8	[/td][td]	98	[/td][/tr]
[tr][td]	5	[/td][td]	Tampa Bay Lightning	[/td][td]	75	[/td][td]	40	[/td][td]	24	[/td][td]	11	[/td][td]	91	[/td][/tr]
[tr][td]	6	[/td][td]	Montreal Canadiens	[/td][td]	76	[/td][td]	40	[/td][td]	29	[/td][td]	7	[/td][td]	87	[/td][/tr]
[tr][td]	7	[/td][td]	New York Rangers	[/td][td]	76	[/td][td]	41	[/td][td]	30	[/td][td]	5	[/td][td]	87	[/td][/tr]
[tr][td]	8	[/td][td]	Buffalo Sabres	[/td][td]	75	[/td][td]	38	[/td][td]	28	[/td][td]	9	[/td][td]	85	[/td][/tr]
[/table]											
This might look a little complex, but if I show you how it looks in Excel then it might be a lot clearer:

Image

This shows quite how simple it is to convert a table in a spreadsheet to a BBCode table which will work in the forums.

And here's how the table itself looks:
[table][tr][th][/th][th]Eastern Conference[/th][th]GP[/th][th]W[/th][th]L[/th][th]OTL[/th][th]Pts[/th][/tr]
[tr][td]1[/td][td]Philadelphia Flyers[/td][td]75[/td][td]45[/td][td]20[/td][td]10[/td][td]100[/td][/tr]
[tr][td]2[/td][td]Washington Capitals[/td][td]76[/td][td]44[/td][td]22[/td][td]10[/td][td]98[/td][/tr]
[tr][td]3[/td][td]Boston Bruins[/td][td]75[/td][td]42[/td][td]23[/td][td]10[/td][td]94[/td][/tr]
[tr][td]4[/td][td]Pittsburgh Penguins[/td][td]76[/td][td]45[/td][td]23[/td][td]8[/td][td]98[/td][/tr]
[tr][td]5[/td][td]Tampa Bay Lightning[/td][td]75[/td][td]40[/td][td]24[/td][td]11[/td][td]91[/td][/tr]
[tr][td]6[/td][td]Montreal Canadiens[/td][td]76[/td][td]40[/td][td]29[/td][td]7[/td][td]87[/td][/tr]
[tr][td]7[/td][td]New York Rangers[/td][td]76[/td][td]41[/td][td]30[/td][td]5[/td][td]87[/td][/tr]
[tr][td]8[/td][td]Buffalo Sabres[/td][td]75[/td][td]38[/td][td]28[/td][td]9[/td][td]85[/td][/tr][/table]

Post Reply

Return to “TBL Announcements and Feedback”