Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
BBCode - Comprehensive set of TABLE tags (BB Code) Details »
BBCode - Comprehensive set of TABLE tags (BB Code)
Mod Version: 1.00, by BirdOPrey5 (IB Staff) BirdOPrey5 is offline
Developer Last Online: Mar 2019 I like it Show Printable Version Email this Page

vB Version: 4.0.x Rating: (3 votes - 5.00 average) Installs: 29
Released: 19 Sep 2010 Last Update: 19 Sep 2010 Downloads: 285
Supported Re-usable Code Translations  

DO NOT USE on vBulletin 4.1.4 or above!
vBulletin 4.1.4 now includes built in support to the TABLE BB Code as part of the new editor. Installing this code will cause conflicts.
If you have this installed, delete it before upgrading to 4.1.4!


WARNING- USING THIS CAN BE A SECURITY RISK!!!
Using this BB Code will allow people who know what they are doing to run arbitrary JavaScript in the code. For this reason I strongly recommend you limit the use of this BB Code to admins and trusted users (mods?) only! You can use the Advanced BB Code Permissions mod to limit this by usergroup. I have it installed on 4.0.8 and it's working well. Thanks to Kyo-Dono for pointing this out.



[tbl],[tr],[td],[th]

Demo URL: http://www.juot.net/forums/showthrea...497#post872497

This is a comprehensive set of codes for making HTML tables. If you're not familiar with HTML tables this code is probably not for you, if you are this should come in very handy.

One of the main limitations of bulletin board software is the inability to put tables into posts. The existing [table] BB Code Mod helps but it is not easy to use and the interface isn't similar to traditional HTML tables. This set of table elements mimic traditional <html> tags and allow for advanced elements like background color, alignment, height and width attributes for any element.
(The existing mod is here: http://www.vbulletin.org/forum/showthread.php?t=107985 you may prefer that to this.)

All HTML tables are made up of at least 3 sets of HTML tags such as:
<table><tr><td>Some Info Here</td></tr></table>

Using this BB Code solution the syntax for the same would simply be:
[tbl][tr][td]Some Info Here[/td][/tr][/tbl]

Note "tbl" is being used instead of "table" to keep compatibility with the existing [table] BB Code.

The code above gives a pretty boring table...

Where this code really shines is that in any of those elements you can use the "option" part of the tag to add attributes to that element, so if you wanted to make the whole table light-blue you could use:
[tbl="bgcolor=lightblue"][tr][td]Some Info Here[/td][/tr][/tbl]

And if you wanted to make the cell 50 pixels high:
[tbl="bgcolor=lightblue"][tr][td="height=50"]Some Info Here[/td][/tr][/tbl]

There are many attributes you may be familiar with for HTML tables, all and any can be used in these tags. A more complicated table would be:
[tbl="border=0 bgcolor=grey align=center"]
[tr][th="bgcolor=lightblue colspan=3"][B]Table Header[/B][/th][/tr]
[tr][td]:pirate:[/td][td="bgcolor=yellow"]:jump:[/td][td]:panic:[/td][/tr]
[tr="bgcolor=pink height=50"][td]:sad:[/td][td]:owned:[/td][td]:thup2:[/td][/tr]
[/tbl]

As you can see you may use other BB Code's within these codes as well as smilies and images.

There are many resources on the web for learning about HTML tables. This is one of many:
http://www.quackit.com/html/codes/html_table_code.cfm

To make this code work its magic we need to install 8 seperate BB Codes (6 if you don't care about table headers).

For each code we want to install it both with and without an "option" attribute- this will make using the code easier when you have no options needed but let you use them anywhere they are needed.

For the sake of simplicity I'm going to skip of few of the most basic steps, BB Codes are generally easy but please make sure you've installed a few before this one.

You can call the tags anything you want, in my examples I used:
tbl = <table> tag... (for compatibility if you have another [table] BB Code installed.
tr = <tr> tag (Table Row)
th = <th> tag (Table Header)
td = <td> tag {Table Data or Cell)

WARNING: If you have the 4.x SUITE there are already table bbcodes for the CMS portion of your site. Because of this you can not use [tr] or [td] as valid bbcode names because they are already in use. Please use something else such as [trr] and [tdd].



For the tags without options use the following replacements:

[tbl]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[th]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[tr]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[td]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

For each of the above I recommend the following example:
[tbl][tr][th]Header[/th][/tr][tr][td]test[/td][/tr][/tbl]
Remember the example won't show correctly until every code in the set is installed.

Add the following code replacements WITH Option-
"Use Option = Enabled"

[tbl]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[th]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[tr]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[td]

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

For all the above codes you want to use the following settings:
Disable Word Wrapping inside BB Code = Yes
All Other Disable Options = No

You will now be able to make complete HTML tables using the tags with or without options as needed.
See the Demo above for this code in action.

Please Mark as Installed if you use this.

Download a copy of the .txt file as a backup.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	ss_tblbbcode.jpg
Views:	1232
Size:	118.3 KB
ID:	122155  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 19 Sep 2010, 23:39
sulasno sulasno is offline
 
Join Date: Feb 2010
tagged and thanks

this is one which is much needed;

code for 2 table headers with 2 rows


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

edit

Installed

edit

table frame not displayed in Slim Browser and Maxthon; will test other browsers

Last edited by sulasno; 20 Sep 2010 at 00:29.
Reply With Quote
  #3  
Old 20 Sep 2010, 00:45
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
That code is working fine for me: http://www.juot.net/forums/showthrea...608#post872608

I've never heard of "Slim" or "Maxthon" browsers I've tested with all the major ones- IE/Firefox/Chrome/Opera/Safari... any browser that can show tables should work.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #4  
Old 20 Sep 2010, 01:42
sulasno sulasno is offline
 
Join Date: Feb 2010
I tried with Chrome (Dev) and couldn't see the table frame; (The table box) ; or there is no table frame ? The Table (code) is working

I copied the table with options code from your site and it doesn't work at my end;

[tbl="border=0 bgcolor=grey align=center"]
[th="bgcolor=lightblue colspan=3"]Table Header[/th]

running vBulletin 4.0.7
Reply With Quote
  #5  
Old 20 Sep 2010, 01:57
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
If by frame you mean border there is no border by default, you need to specify it in the options like:
[tbl="border=2"]
[tr][td]There is a border around this.[/td][/tr]
[/tbl]

As for the code you posted:
[tbl="border=0 bgcolor=grey align=center"]
[th="bgcolor=lightblue colspan=3"]Table Header[/th]
You're missing the [tr] tags and the closing [/tbl] tag... You'd need at least:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #6  
Old 20 Sep 2010, 02:20
sulasno sulasno is offline
 
Join Date: Feb 2010
table border - thanks

missing tags - (lol) I copied the code from your site and


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

is being displayed instead of the (complete) table
Reply With Quote
  #7  
Old 20 Sep 2010, 03:04
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
OK
I Put the code on my page inside [code] tags so it's easier to copy if need be.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #8  
Old 22 Sep 2010, 10:49
TeknoSounds TeknoSounds is offline
 
Join Date: Nov 2006
Hmm, I'm using the option version, and setting border=0 doesn't seem to remove the border from the table. You can see on my site's main page: http://teknosounds.com

it starts out with: [tbl="border=0 align=center"]
Reply With Quote
  #9  
Old 22 Sep 2010, 12:16
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by TeknoSounds View Post
Hmm, I'm using the option version, and setting border=0 doesn't seem to remove the border from the table. You can see on my site's main page: http://teknosounds.com

it starts out with: [tbl="border=0 align=center"]
I see you have a .css file over-riding your default style of the table <td> tag, so you need to manually tell it to have no border in each [td] tag, I see you already use align=center... change each [td] tag to:
[td="align=center style='border: 0px;' "]

And you'll have no border.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #10  
Old 22 Sep 2010, 15:35
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Real name: Col
Thumbs up

Awesome ....will add this later ..thanks for these ..great work as usual .hits install incase i forget later
Reply With Quote
  #11  
Old 25 Sep 2010, 17:57
Tony_FPM Tony_FPM is offline
 
Join Date: Feb 2005
Thanks!

How do i fix this problem with the <br> line breaks ?

Reply With Quote
  #12  
Old 25 Sep 2010, 18:18
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
That seems to be a side effect of putting code on its own/new line... if you remove all the line breaks in your code it works as expected.

In other words use this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Instead of this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #13  
Old 26 Sep 2010, 02:21
sulasno sulasno is offline
 
Join Date: Feb 2010
perhaps installing this would help;

http://www.vbulletin.org/forum/showthread.php?t=230859
Reply With Quote
  #14  
Old 26 Sep 2010, 04:59
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by sulasno View Post
perhaps installing this would help;

http://www.vbulletin.org/forum/showthread.php?t=230859
I'd be interested if anyone tries it but from what I can see I don't think it will be of much help. The issue is vbulletin turns the line-breaks in the editor window into <br> tags outside the table.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #15  
Old 26 Sep 2010, 05:07
sulasno sulasno is offline
 
Join Date: Feb 2010
I use the line by line table code together with the mod that I mentioned and there is no extra space

see [link removed]

Last edited by sulasno; 26 Sep 2010 at 05:56.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 00:33.

Layout Options | Width: Wide Color: