BBCode Tables

Get help developing custom BBCodes or request one.
Post Reply
Eddie Felson
Registered User
Posts: 16
Joined: Thu Sep 04, 2014 7:59 pm

BBCode Tables

Post by Eddie Felson » Sun Jan 24, 2016 8:58 pm

Hello,
in phpBB 2.0 and 3.0 i used the folowing bbcodes for tables. Since 3.1 apears tables without borders. Can anybody help me?

Code: Select all

[table]{TEXT}[/table]

Code: Select all

<table border="1"> {TEXT}</table>

Code: Select all

[td]{TEXT}[/td]

Code: Select all

<td>{TEXT}</td>

Code: Select all

[tf]{TEXT}[/tf]

Code: Select all

<th colspan="2">{TEXT}</th>

Code: Select all

[th]{TEXT}[/th]

Code: Select all

<th>{TEXT}</th>

Code: Select all

[tr]{TEXT}[/tr]

Code: Select all

<tr>{TEXT}</tr>

Regards

User avatar
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: BBCode Tables

Post by Puchahawa » Sun Jan 24, 2016 10:09 pm

These show the borders for me on a 3.1.7 board.

table html replacement

Code: Select all

<div style="line-height: 0px; border: 1px solid black;"><table style="border-collapse: collapse;" width=100%>{TEXT}</table></div>
row html replacement

Code: Select all

<tr>{TEXT}</tr>
column html replacement

Code: Select all

<td width="100" style="line-height: 100%; outline: thin solid black; padding: 9px;" valign=top>{TEXT}</td>
There is an ext that sniper E created that you may want to look at too. You'll need to register on the site to check it out though.
Avatar courtesy of artist Faith Coyotë

Eddie Felson
Registered User
Posts: 16
Joined: Thu Sep 04, 2014 7:59 pm

Re: BBCode Tables

Post by Eddie Felson » Mon Jan 25, 2016 1:40 am

Hello,
thank you very much, it works fine so far.

some additional questions.

It is possible to change the table to 'auto fit' all columns?
It looks like strange, in a table with e.g. 3 col. and the first col. contains only 1, 2, 3, etc.
This small col. apears with 33% of total width (my forum is very wide)

The first and the last horizontal line is thinner than the separating lines of the rest of the table.
Do you have a proposal for a additional [td] html replacement for the first line?
for example a thicker outline
and
a alternative backround color

Same problem with the first and the last vertical line, they are smaler, but shout be thicker.

Many thanks in advance

Kind Regards

User avatar
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: BBCode Tables

Post by Puchahawa » Mon Jan 25, 2016 2:30 am

I'm not sure. :( I don't know enough about html to guess.
Avatar courtesy of artist Faith Coyotë

User avatar
cprgolds
Registered User
Posts: 446
Joined: Thu Oct 11, 2007 5:49 am
Location: Portland, Oregon

Re: BBCode Tables

Post by cprgolds » Mon Jan 25, 2016 3:56 am


User avatar
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: BBCode Tables

Post by Puchahawa » Mon Jan 25, 2016 5:12 am

Hey eddie, I've just been playing with Sniper E's table extension and thought I would share what I found. Here is the table info I used. You can see the width of the table is defined (% of page) along with the # of columns in the first line. Second line determines width of each column (% of table) and column titles. after that it's the rows. the # after td=row# is the # of columns spanned.

Code: Select all

[table=20][tr][td=cat 2][align=center]Animals[/align][/td][/tr]
[tr][th=50 1]Dogs[/th][th=50 2]Cats[/th][/tr]
[tr][td=row1 1]Cavaliers[/td][td=row1 1]Tabbies[/td][/tr]
[tr][td=row2 1]Terriors[/td][td=row2 1]Pursians[/td][/tr][/table]

[table=70][tr][td=cat 4]4 column table[/td][/tr]
[tr][th=15 1]column1[/th][th=35 1]column 2[/th][th=15 1]column 3[/th][th=35 1]column 4[/th][/tr]
[tr][td=row1 1]something[/td][td=row1 1]more[/td][td=row1 1]is[/td][td=row1 1]happening[/td][/tr]
[tr][td=row2 1]additional[/td][td=row2 3]this is covering 3 columns[/td][/tr]
[tr][td=row3 2]checking[/td][td=row3 1]about[/td][td=row3 1]row numbers[/td][/tr][/table]
and this is the output.
table.PNG
Avatar courtesy of artist Faith Coyotë

Eddie Felson
Registered User
Posts: 16
Joined: Thu Sep 04, 2014 7:59 pm

Re: BBCode Tables

Post by Eddie Felson » Mon Jan 25, 2016 8:23 pm

thx

Eddie Felson
Registered User
Posts: 16
Joined: Thu Sep 04, 2014 7:59 pm

Re: BBCode Tables

Post by Eddie Felson » Tue Jan 26, 2016 12:51 am

I modified the code posted by Puchahawa.

Here is my solution with Col. autofit and a thicker top line. All lines in gray for dark theme. I use other tag names!

BBCode

Code: Select all

[table]{TEXT}[/table] 


HTML-Replacement

Code: Select all

<div style="line-height: 0px;margin-top: 5px;margin-bottom: 5px;"><table style="border-collapse: collapse;">{TEXT}</table></div>
Help:

Code: Select all

Table

BBCode

Code: Select all

[tr]{TEXT}[/tr]
HTML-Replacement

Code: Select all

<tr>{TEXT}</tr>
Help:

Code: Select all

Table Row

BBCode

Code: Select all

[tf={NUMBER}]{TEXT}[/tf]
HTML-Replacement

Code: Select all

<td colspan="{NUMBER}"style="line-height: 100%; border-top: solid gray; border-bottom: solid gray; border-left: thin solid gray; border-right: thin solid gray; padding: 9px;" align=center>{TEXT}</td>
Help:

Code: Select all

Title Row Example for table with 3 col. [tr][tf=3]Dummy[/tf][/tr]

BBCode

Code: Select all

[th]{TEXT}[/th]
HTML-Replacement

Code: Select all

<td style="line-height: 100%; border-top: solid gray; border-bottom: solid gray; border-left: thin solid gray; border-right: thin solid gray; padding: 9px;" align=center>{TEXT}</td>
Help:

Code: Select all

Header Cell

BBCode

Code: Select all

[td]{TEXT}[/td]
HTML-Replacement

Code: Select all

<td style="line-height: 100%; border-top: thin solid gray; border-bottom: thin solid gray; border-left: thin solid gray; border-right: thin solid gray; padding: 5px;" align=right>{TEXT}</td>
Help:

Code: Select all

Normal Cell

Example Code (dot and comma is changed for germany)

Code: Select all

[table][tr][tf=8]Dummy[/tf][/tr][tr][th][b]Player[/b][/th][th][b]Val. 1[/b][/th][th][b]Val. 2[/b][/th][/tr][tr][td]A[/td][td]379[/td][td]0,83[/td][/tr][tr][td]B[/td][td]5.599[/td][td]0,75[/td][/tr][tr][td]C[/td][td]4.849[/td][td]1,31[/td][/tr][tr][td]D[/td][td]413[/td][td]2,77[/td][/tr][/table]
Tested phpBB 3.17 with style black (prosilver)

Eddie Felson
Registered User
Posts: 16
Joined: Thu Sep 04, 2014 7:59 pm

Re: BBCode Tables

Post by Eddie Felson » Wed Jan 27, 2016 12:15 am

Two changes:

colspan=30
For colspan is the exact no of col. not needed. It must be higher than the col. in the table. i try 30, I think it's enough :)

BBCode

Code: Select all

[tf]{TEXT}[/tf]
HTML-Replacement

Code: Select all

<td colspan=30 style="line-height: 100%; border-top: solid gray; border-bottom: solid gray; border-left: thin solid gray; border-right: thin solid gray; padding: 9px;" align=center><b>{TEXT}</b></td>
Help:

Code: Select all

Title Row Example for table with 3 col. [tr][tf]Dummy[/tf][/tr]


Header Cells in bold

BBCode

Code: Select all

[th]{TEXT}[/th]
HTML-Replacement

Code: Select all

<td style="line-height: 100%; border-top: solid gray; border-bottom: solid gray; border-left: thin solid gray; border-right: thin solid gray; padding: 9px;" align=center><b>{TEXT}</b></td>
Help:

Code: Select all

Header Cell

User avatar
shijixuexi
Registered User
Posts: 64
Joined: Thu Nov 15, 2012 6:25 am
Contact:

Re: BBCode Tables

Post by shijixuexi » Fri Dec 30, 2016 9:25 am

Good codes,

A question,
the new bbcodes that replaced work well with new posts,

but the old posts not, they show like

Code: Select all

[table][td]...
the old posts need to be edited to show right,
Do you have that problem? Is these a script to do that?
My phpBB site is: http://forum.shijixuexi.com/
phpBB Version: 3; Style: prosilver Special Edition; Default language: Traditional Chinese

Post Reply

Return to “Custom BBCode Development and Requests”