New BBCodes for tables

Any site announcements will be made here. Also the place to make suggestions to help improve this site. Also use this forum for reporting suspected errors or for asking 'how to' questions.
Post Reply
User avatar
Robert T
Site Admin
Joined: Mon 12 Jun, 2006 10:35
Posts: 10170

  Z3 roadster 1.9
Location: Cheshire

New BBCodes for tables

Post by Robert T »

I recently added some new BBCodes to allow tables to be nicely formatted on the page. Preciously the only way to actually build a table was to use code tags. The new tags are a bit basic and need to be laid out on one line, but they do work, so I might as well document them here.

Here is a quick example of a table:
[col]Alpha[/col][col]Beta[/col][col]Gamma[/col][col]Delta[/col]
Column OneColumn Two
And here is the BBCode that created it:

Code: Select all

[table] [row][head]Column One[/head][head]Column Two[/head][/row] [row][col]Alpha[/col][col]Beta[/col][/row] [row][col]Gamma[/col][col]Delta[/col][/row] [/table]
Each cell of the table is enclosed in either head or col tags - head giving the white on blue heading style. Sets of cells are grouped into rows using the row tag around all the cells in the row. Finally the whole thing is enclosed in a table tag.

Another quick example with the column values centred (at the request of Brian H) and right-justified:
Column OneColumn Two
AlphaBeta
GammaDelta
And here is the BBCode:

Code: Select all

[table][row][head]Column One[/head][head]Column Two[/head][/row] [row][col=center]Alpha[/col][col=right]Beta[/col][/row] [row][col=center]Gamma[/col][col=right]Delta[/col][/row][/table]
I will try, at some point, to make the background of the table body alternate in colour to make it more readable - useful for reading off part numbers etc.

Cheers R.
Arctic Silver '99 Z3 1.9 & Black '59 Frogeye 1275cc
Image
gookah
Z Register member
Joined: Thu 07 Aug, 2008 09:51
Posts: 2737

  Z3 roadster 2.8

Re: New BBCodes for tables

Post by gookah »

Yep, thats exactly what I would have done....


(Looks like English,..... but I'm not sure)
Image

Z3 2.8 Progress Journal (Mine)
Z3 1.9 Sport Progress Journal (Wifey's)

I have an element of 'M-styling' on my car, If that's a good enough reason for the manufacturers to adorn a 320 with the M badge, then its certainly a good enough reason for me..
User avatar
Robert T
Site Admin
Joined: Mon 12 Jun, 2006 10:35
Posts: 10170

  Z3 roadster 1.9
Location: Cheshire

Re: New BBCodes for tables

Post by Robert T »

Yeah, I know. It helps if you know how to write HTML, as the tags follow the same basic pattern. There must be an easier way for non-geeks to write tables in a forum, but it's sure as hell not built into phpBB. If I can find the time, I think it might be worth writing something that renders a simple list of values separated by commas (known to geeks as Comma Separated Variable) into a table.

Code: Select all

[csv]
Column One, Column Two
Alpha,Beta
Gamma,Delta
[/csv]
Simple to write, but quite a few hours taking phpBB apart to make it work, methinks.

Cheers R.
Arctic Silver '99 Z3 1.9 & Black '59 Frogeye 1275cc
Image
User avatar
pingu
Joined: Fri 30 Apr, 2004 16:01
Posts: 3412

  M roadster S50

Re: New BBCodes for tables

Post by pingu »

In a previous life I used to create csv files and the code to manipulate them, so I understand what you are doing.

Computer languages are like learning a foreign language. Once you have learnt one, others are easier to learn.

Anyway, another useful piece of code you could investigate is the code to embed a Youtube clip. All the embedded clips added before the upgrade no longer work.

Many thanks for your work so far.
Pingu
User avatar
Robert T
Site Admin
Joined: Mon 12 Jun, 2006 10:35
Posts: 10170

  Z3 roadster 1.9
Location: Cheshire

Re: New BBCodes for tables

Post by Robert T »

That one is simples, pingu. Already built-in and enabled.

Here is the lovely Lana Del Rey singing Video Games:



And here is how to get her in your own posts:

Code: Select all

[flash=560,315]http://www.youtube.com/v/cE6wxDqdOV0?version=3&hl=en_GB[/flash]
Please don't abuse this. I have left it on, but I can (and will) turn it off if people misuse it.

Cheers R.
Arctic Silver '99 Z3 1.9 & Black '59 Frogeye 1275cc
Image
User avatar
pingu
Joined: Fri 30 Apr, 2004 16:01
Posts: 3412

  M roadster S50

Re: New BBCodes for tables

Post by pingu »

I shall spend a few happy hours re-embedding my "How to" videos using the new code :nerd: .

TA
Pingu
User avatar
Robert T
Site Admin
Joined: Mon 12 Jun, 2006 10:35
Posts: 10170

  Z3 roadster 1.9
Location: Cheshire

Re: New BBCodes for tables

Post by Robert T »

Thanks, pingu, I appreciate the effort.

Cheers R.
Arctic Silver '99 Z3 1.9 & Black '59 Frogeye 1275cc
Image
User avatar
Brian H
Joined: Tue 16 Dec, 2008 19:55
Posts: 2505

  Z3 roadster 3.0i

New BBCodes for tables

Post by Brian H »

I recently tried to embed a small youtube clip as explained above, I get the a message stating "You cannot use certain BBCodes: [flash]." Is this because I am doing something wrong? or is this a Moderator option only.

Thanks

Brian
User avatar
Robert T
Site Admin
Joined: Mon 12 Jun, 2006 10:35
Posts: 10170

  Z3 roadster 1.9
Location: Cheshire

Re: New BBCodes for tables

Post by Robert T »

Sorry Brian, it turns out that it needs to be enabled on each individual forum, and we'd prefer not to be swamped with hundreds of flash ads - I will get round to creating a youtube tag eventually which will just do youtube vids - for now, if you post the link and PM me, I will fix it for you, as it checks the permissions when the post is made, rather than every time it is viewed, so I can add the tags for you.

Edit: I will need to know the width and height to make the video - you can get these by clicking the embed button on youtube - if you can post them, it will save me a job of looking them up.

Cheers R.
Arctic Silver '99 Z3 1.9 & Black '59 Frogeye 1275cc
Image
User avatar
Robert T
Site Admin
Joined: Mon 12 Jun, 2006 10:35
Posts: 10170

  Z3 roadster 1.9
Location: Cheshire

Re: New BBCodes for tables

Post by Robert T »

Just a quick update to say that I have now added the ability to change the alignment of cells in a table - instead of the col tag, you now use a new col= tag which allows you to specify left, right or center (note spelling - this is how HTML expects it to be written). I have updated the lead post with this info.

Cheers R.
Arctic Silver '99 Z3 1.9 & Black '59 Frogeye 1275cc
Image
Post Reply