MyBB Community Forums

Full Version: Adding Tables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to add something pro , plugin or Mycode for a table but it must include
Table Alignment , Table width and border color
The easiest way is to do a custom code for table, tr, and td. These can be managed in the Admin CP. ACP->Config->MyCode

Table
Regex: \[table\salign=(left|right|center)\swidth=([0-9]){1,}(px|\%)\scolor=([0-9a-f]){6}\](.*)\[\/table\]
Replacement: <table style="text-align:$1;width=$2$3;border-color:#$4">$5</table>

Table Row
Regex: \[tr\](.*)\[\/tr\]
Replacement: <tr>$1</tr>

Table Cell
Regex: \[td\](.*)\[\/td\]
Replacement: <td>$1</td>

Example of usage:
Example Usage: [table align=left width=300px color=0000AA][tr][td]Table Cell Content[/td][/tr][/table]
Not Working in all

Title *
Table
Short Description

Regular Expression *
\[table\salign=(left|right|center)\swidth=([0-9]){1,}(px|\%)\scolor=([0-9a-f]){6}\](.*)\[\/table\]
\[tr\](.*)\[\/tr\]
\[td\](.*)\[\/td\]

Replacement *
<table style="text-align:$1;width=$2$3;border-color:#$4">$5</table>
<tr>$1</tr>
<td>$1</td>

Enabled? *
Yes
Parse Order
0
Try changing the table one to this:
Regex: \[table\salign=(left|right|center)\swidth=([0-9]){1,}(px|\%)\scolor=([0-9a-f]{6})\](.*)\[\/table\]
Replace: <table style="text-align:$1;width=$2$3;border:2px solid #$4">$5</table>

I had a parenthesis in the wrong spot. This makes the border 2 pixels wide, but you can change that.
Also didnt work
I'm unsure why it isn't working for you. I have it working just fine on my test site.
proof of concept
(2014-07-17, 04:16 PM)dragonexpert Wrote: [ -> ]I'm unsure why it isn't working for you. I have it working just fine on my test site.
proof of concept

Please Copy Your MyCode in your website and paste no need to put each one and its html code i want all of them together and example using BBCode
http://nc-gaming.gegahost.net
Any 1?
2nd BUMP
You can't do it with just one code unless it is done specifically as a plugin. If you don't want it as a plugin, you need separate codes for the table, table row, and table cell.
Pages: 1 2