Solved: 8 Years, 7 Months, 3 Weeks ago Custom BBCode Assistance: Tables
#1
Solved: 8 Years, 7 Months, 3 Weeks ago
Hello everybody! So, I'm finally having an influx of new members show up at my site, and they have all requested for the same thing:

On their old site, they had an easy to use bbcode that when you typed in [table][/table], and created breaks by using the enter key on your keyboards, you could create fully functional tables. How would I go about incorporating this unto MyBB? Their old forums had been run on Vbulletin, but I would still like to be able to know how to add this function in.

Thanks! Smile Big Grin

Also, PS: You also created new columns in the table by using the "|" key, lmfao Big Grin Toungue

Thanks again!!!! Toungue
#2
Solved: 8 Years, 7 Months, 3 Weeks ago
You will need a WYSIWYG editor. Search for Hoteditor on the forums.
#3
Solved: 8 Years, 7 Months, 3 Weeks ago
(06-28-2010, 05:49 AM)Bob Jansen Wrote: You will need a WYSIWYG editor. Search for Hoteditor on the forums.

My only problem with this is that I had this installed previously and my community can be incredibly stubborn and simplistic--basically they got really put off by the new posting options, just got generally confused and all as one requested that I took it down....it didn't really work out.

I thought I saw somewhere fumbling around in my Admin CP that there was like an option for Custom BBCodes or something like that...there's no way that I can just add this requested table feature in there?!?! Huh
#4
Solved: 8 Years, 7 Months, 3 Weeks ago
Someone doesn't want a WYSIWYG?? I think I need to sit down Toungue A lot of people seem to want one as though their forum won't function without it, even though I can't see why you need one on a forum when 99% of posts are completely plain text...

Anyway, yes you can add these with custom MyCodes. Something like this:

Regular Expressions:

\[table\](.*?)\[/table\]
\[tr\](.*?)\[/tr\]
\[td\](.*?)\[/td\]

Replacements:

<table>$1</table>
<tr>$1</tr>
<td>$1</td>

Then you'd use this in posts:

[table]
[tr]
[td]Text[/td]
[td]Text[/td]
[/tr]
[tr]
[td]Text[/td]
[td]Text[/td]
[/tr]
[/table]

You could add some more advanced ones to add options to the tags, maybe something like this:

Regular Expressions:

\[td=([0-9])\](.*?)\[/td\]

Replacements:

<td colspan="$1">$2</td>

Note that I know very little about regular expressions so I don't know if these are very secure, hopefully someone who knows more about them will post here and advise on that.

Anyway, hope that helps.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
#5
Solved: 8 Years, 7 Months, 3 Weeks ago
Can't show table Sad

[table][tr][td]
STT
[/td][td]
Mã vật tư
[/td][td]
Tên vật tư
[/td][td]
Đơn vị
[/td][td]
Giá
[/td][/tr][tr][td]1[/td][td]VL010142[/td][td]A xít hàn[/td][td]Lít[/td][td]1000[/td][/tr][/table]

http://www.cic.com.vn/Escon8/BaoGia/1285976993.zip
[table]
[tr]
[td]Text[/td]
[td]Text[/td]
[/tr]
[tr]
[td]Text[/td]
[td]Text[/td]
[/tr]
[/table]
#6
Solved: 8 Years, 7 Months, 3 Weeks ago
(10-04-2010, 02:52 AM)nhhacic Wrote: Can't show table Sad

[table][tr][td]
STT
[/td][td]
Mã vật tư
[/td][td]
Tên vật tư
[/td][td]
Đơn vị
[/td][td]
Giá
[/td][/tr][tr][td]1[/td][td]VL010142[/td][td]A xít hàn[/td][td]Lít[/td][td]1000[/td][/tr][/table]

http://www.cic.com.vn/Escon8/BaoGia/1285976993.zip
[table]
[tr]
[td]Text[/td]
[td]Text[/td]
[/tr]
[tr]
[td]Text[/td]
[td]Text[/td]
[/tr]
[/table]

Did you add what Matt said to do in your copy?
I'm not here often, shoot a PM or whatever if you want my discord.
#7
Solved: 8 Years, 7 Months, 3 Weeks ago
This user has been denied support. This user has been denied support.
Dude its better to have WYSIWYG editor then adding this codes !
#8
Solved: 8 Years, 7 Months, 3 Weeks ago
(10-09-2010, 05:14 AM)crazy4cs Wrote: Dude its better to have WYSIWYG editor then adding this codes !

...Why?
I'm not here often, shoot a PM or whatever if you want my discord.


Forum Jump:


Users browsing this thread: 1 Guest(s)