Create tables in a post

Get help developing custom BBCodes or request one.
faszikam
Registered User
Posts: 2
Joined: Mon Aug 25, 2008 1:17 pm

Create tables in a post

Post by faszikam » Mon Aug 25, 2008 1:19 pm

Not in the database, but in a posting. Any ideas, folks?
Last edited by ric323 on Tue Mar 31, 2009 9:42 am, edited 1 time in total.
Reason: Topic icon changed

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Create tables in a post

Post by Erik Frèrejean » Mon Aug 25, 2008 1:22 pm

Probably the easiest way is to set up 5 different custom BBCodes.
  1. [table] -> <table>
  2. [tr] -> <tr>
  3. [td]{SIMPLE_TEXT}[/td] -> <td>{SIMPLE_TEXT}</td>
  4. [/tr] -> </tr>
  5. [/table] -> </table>
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

faszikam
Registered User
Posts: 2
Joined: Mon Aug 25, 2008 1:17 pm

Re: Create tables in a post

Post by faszikam » Tue Aug 26, 2008 12:08 pm

Didn't work for me. I have checked the settings in the CP, and BBCode is enabled... The following is my code. Any further ideas. Thanks, BTW.

[table]
[tr]
[td]M/cl overweight bag[/td]
[td]between 23 and 32 kg[/td]
[td]$150 worldwide[/td]
[/tr]
[tr]
[td]Extra piece[/td]
[td]beyond the two included in the FBA[/td]
[td]$200 to IATA Europe, $250 beyond[/td]
[/tr]
[tr]
[td]Oversized[/td]
[td]Over 158 cm (62 in)[/td]
[td]$200 to IATA Europe, $250 beyond[/td]
[/tr]
[tr]
[td]Over 32 kg[/td]
[td]In all classes[/td]
[td]$350 to IATA Europe, $400 beyond[/td]
[/tr]
[/table]

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Create tables in a post

Post by Erik Frèrejean » Tue Aug 26, 2008 12:12 pm

Did you create the custom BBCodes I suggested?
Knowledge Base - Adding Custom BBCodes in phpBB3
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

midlis
Registered User
Posts: 3
Joined: Sat Aug 30, 2008 7:35 pm

Re: Create tables in a post

Post by midlis » Sat Aug 30, 2008 9:47 pm

The solution that has worked for me:

Define three custom BBCodes:
  1. define table BBCode

    Code: Select all

    [table]{TEXT}[/table]

    Code: Select all

    <table border="1">{TEXT}</table> 
  2. define tr BBCode

    Code: Select all

    [tr]{TEXT}[/tr]

    Code: Select all

    <tr>{TEXT}</tr>
  3. define td BBCode

    Code: Select all

    [td]{TEXT}[/td]

    Code: Select all

    <td style="padding:0 10px 0 10px;">{TEXT}</td>
and then your code should work, too.

BTW The whole table has to be entered on a single line otherwise there will be a gap in the post (probably related to <br /> inserted in post's EOL mentioned elsewhere on the forum).

User avatar
Fragmeat
Registered User
Posts: 2
Joined: Thu Jan 22, 2009 7:50 pm

Re: Create tables in a post

Post by Fragmeat » Thu Mar 05, 2009 4:55 pm

I've added the custom BBCodes as suggested by midlis and they work great. Thanks. Only problem I'm having is that for every row in the table an extra blank line appears above the table.

For example:
I have a paragraph of text then, all on one line, I have a table with 4 rows of data. When I submit it, it creates the paragraph of text followed by unexpected 4 blank lines then the table as expected. I've experimented with different numbers of rows and there is a direct correlation between the number of rows in the table and the number of blank lines above the table.

We are using phpBB 3.0.1. Any ideas as to why that may be happening?

User avatar
lemina
Registered User
Posts: 24
Joined: Thu Jul 17, 2008 7:51 am
Location: Bülach (Switzerland)

Re: Create tables in a post

Post by lemina » Mon Mar 30, 2009 6:19 pm

I've created BBcodes for creating table - it works wonderful, but... Well I have problem with big space which is between text above the table and table. Sometimes I have to roll down one page down, and there still nothing. Example here

Maybe you know what should be done to do not have such big, empty hole?

User avatar
ric323
Former Team Member
Posts: 22908
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Create tables in a post

Post by ric323 » Mon Mar 30, 2009 9:42 pm

lemina wrote: I have problem with big space which is between text above the table and table. Sometimes I have to roll down one page down, and there still nothing. Example here

Maybe you know what should be done to do not have such big, empty hole?
Edit your post, and remove all the line breaks between the cells.
It will make the layout harder to read while editing, but should stop them showing up in the final post.
(This is what midlis was referring to at the end of his post.)
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
lemina
Registered User
Posts: 24
Joined: Thu Jul 17, 2008 7:51 am
Location: Bülach (Switzerland)

Re: Create tables in a post

Post by lemina » Tue Mar 31, 2009 9:02 am

ric323 wrote:Edit your post, and remove all the line breaks between the cells.
It will make the layout harder to read while editing, but should stop them showing up in the final post.
(This is what midlis was referring to at the end of his post.)
You are right - it's works. It much more less readable, but the table is not going down anymore. But - I tried and the new line can be use between [td] [/td] markers - the table is not going down. Only enter between [/tr][tr] caused big hole. :)

Thank you for help.

marksalehouse
Registered User
Posts: 268
Joined: Tue Dec 28, 2004 5:35 pm
Location: N.I.
Contact:

Re: Create tables in a post

Post by marksalehouse » Tue Mar 31, 2009 11:02 am

BAD LOOKING CELL:

PHPBB is not keen on extraneous spaces so you need to define a (non breaking) space as BBcode.

[space]&nbsp;[/space]

&nbsp;



Then use it in your table.

[table][tr][td]M/cl overweight bag[/td]
[td]between 23 and 32 kg[/td]
[td]$150 worldwide[/td][/tr]
[tr][td][space]&nbsp;[/space][/td]
[td]beyond the two included in the FBA[/td]
[td]$200 to IATA Europe, $250 beyond[/td][/tr]
[tr][td]Oversized[/td]
[td]Over 158 cm (62 in)[/td]
[td]$200 to IATA Europe, $250 beyond[/td][/tr]
[tr][td]Over 32 kg[/td]
[td]In all classes[/td]
[td]$350 to IATA Europe, $400 beyond[/td][/tr][/table]

looks good on my Forum.

mark

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51179
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Create tables in a post

Post by Brf » Tue Mar 31, 2009 11:20 am

Try the table bbcode definitions from this post: http://www.phpbb.com/community/viewtopi ... 5#p4078025

User avatar
Fragmeat
Registered User
Posts: 2
Joined: Thu Jan 22, 2009 7:50 pm

Re: Create tables in a post

Post by Fragmeat » Tue Mar 31, 2009 2:04 pm

ric323 wrote:Edit your post, and remove all the line breaks between the cells.
It will make the layout harder to read while editing, but should stop them showing up in the final post.
(This is what midlis was referring to at the end of his post.)
Thanks ric323 (sorry I missed that midlis), that solved it for me too.
The simple solution seems to be to leave the line breaks in while creating/editing the post, so it's manageable, then just remove them before actually posting it.

messengermatt
Registered User
Posts: 86
Joined: Sun Mar 16, 2008 11:01 pm

Re: Create tables in a post

Post by messengermatt » Thu Sep 03, 2009 2:14 pm

http://wholeplate.co.uk/forum/viewtopic ... 6&p=14#p14

I dont know if you can see it but i have got all the tables on the same line and it stil leaves a big space at the top

It's ok i sorted it

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51179
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Create tables in a post

Post by Brf » Thu Sep 03, 2009 5:10 pm

Brf wrote:Try the table bbcode definitions from this post: http://www.phpbb.com/community/viewtopi ... 5#p4078025

midlis
Registered User
Posts: 3
Joined: Sat Aug 30, 2008 7:35 pm

Re: Create tables in a post

Post by midlis » Thu Oct 01, 2009 9:11 pm

Brf wrote:Try the table bbcode definitions from this post: http://www.phpbb.com/community/viewtopi ... 5#p4078025
That's a smart trick using the comments to get rid of the end-of-lines. Thanks Brf!

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: Big Mac and 10 guests