[BBCode] Table

Mods, snippets and styles postet and supported by the users
Forum rules
As the forum title says this is for User Contributions
Post a support request in this forum and you will be banned!
Chico Gois
BBCoder II
BBCoder II
Posts: 10
Joined: 08 Mar 2010, 15:00

[BBCode] Table

Post by Chico Gois » 20 Apr 2012, 04:38

Description: Lets you add custom table.

Features:
- How many lines you want.
- How many columns you want

BBCode:

Code: Select all

[tabela]{TEXT}[/tabela]
HTML replacement:

Code: Select all

<script language="Javascript">
var texto = '{TEXT}';
texto = texto.replace("\r\n","");
texto = texto.replace("<br>","");
texto = texto.replace(" ","");
var linha = new Array();
linha = texto.split('L=');
var table = '<div align="center"><TABLE width=70% cellpadding=1 cellspacing=1 border=0>';
for (var i=1; i<linha.length; i++)
{
  table = table + '<TR>';
  var coluna = new Array();
  coluna = linha[i].split('&');
  for (var j=0; j<coluna.length; j++)
  {
    if (i == 1)
    {
      table = table + '<TD align=center style="background: #FF8904; font-size:11px; color:black; font-family:  Verdana,Arial, Helvetica, sans-serif;"><b>' + coluna[j].replace("amp;","") + '</b></TD>';      
    }
    else
    {
      table = table + '<TD style="background: #878282; font-size:11px; color:white; font-family:  Verdana,Arial, Helvetica, sans-serif;">' + coluna[j].replace("amp;","") + '</TD>';      
    }

  }
  table = table + '<TR>';
}
table = table + '</TABLE></div>';
document.write(table);
</script>
Use:

Code: Select all

Separate the L rows and columns with = &

[tabela]
L=Nome&Nick&Sexo
L=Tiago&Sapporo&Masculino
L=Laura&Witch&Feminino
L=Cesar&Rasec&Masculino
[/tabela]

Obs.:
- The style can be changed completely.
- The first style is referred to the header and the second table with all the other lines.

Screen:
bb.JPG
Demo:
http://www.mundophpbb.com.br/forum/view ... p?f=11&t=8
You do not have the required permissions to view the files attached to this post.


acidrain83
BBCoder II
BBCoder II
Posts: 6
Joined: 07 May 2012, 01:07
BBCodes: 2

[BBCode] Table

Post by acidrain83 » 09 May 2012, 03:54

thx for this table
but i have a little problem
the text is not center.....what can i do???
please help...i have add the bbcode and the html code like here...
only the colors edited

Chico Gois
BBCoder II
BBCoder II
Posts: 10
Joined: 08 Mar 2010, 15:00

[BBCode] Table

Post by Chico Gois » 09 May 2012, 15:10

It has a screen?

Upside555
BBCoder II
BBCoder II
Posts: 25
Joined: 11 Apr 2012, 18:36
BBCodes: 0

[BBCode] Table

Post by Upside555 » 09 May 2012, 19:34

Thanks , guud bbcode

acidrain83
BBCoder II
BBCoder II
Posts: 6
Joined: 07 May 2012, 01:07
BBCodes: 2

[BBCode] Table

Post by acidrain83 » 10 May 2012, 04:53

i know that here is a creen but on my forum it is not center..


webmaster
BBCoder II
BBCoder II
Posts: 69
Joined: 19 Nov 2011, 21:52
BBCodes: 5
Favourite BBCode: Rainbow
Favourite MOD: Please wait
Location: Bangladesh

[BBCode] Table

Post by webmaster » 14 May 2012, 11:54

Nice share dude..!!

aydin1954
BBCoder I
BBCoder I
Posts: 1
Joined: 28 Jun 2012, 15:04
BBCodes: 3

[BBCode] Table

Post by aydin1954 » 28 Jun 2012, 15:07

Hello & nice contribution, simple and efficient.

I was wondering if you could make the style configurable. Have a default if no variables are entered but let the different component of the style be configurable by the user.

Thanks for considering. :thumb:

User avatar
KreatorTeam
BBCoder II
BBCoder II
Posts: 8
Joined: 18 Apr 2010, 18:01
Location: Torino

[BBCode] Table

Post by KreatorTeam » 16 Aug 2012, 08:43

Hi, anyone know how to do it this , the link clickable http://i.imgur.com/41EHL.png ?
Thanks !

Rigo
BBCoder I
BBCoder I
Posts: 2
Joined: 31 Oct 2013, 13:59
BBCodes: 8

[BBCode] Table

Post by Rigo » 01 Aug 2014, 23:36

I know this thread is old but the code is awesome. I put it on my boards and it shows on the previews I do while working on it. However, when I submit the post, it does not show (it's blank) Why is that?
You do not have the required permissions to view the files attached to this post.

Potku
BBCoder II
BBCoder II
Posts: 21
Joined: 07 Jun 2010, 14:04

[BBCode] Table

Post by Potku » 20 Aug 2014, 07:02

We have the same problem: preview shows it nicely, but the table disappears once the post has been sent. That's really weird.

This would be so, so much easier than the table BBCode we have had for years. I wish someone could help Rigo and me.