02-02-2016, 14:43
Looking at the site, I see there's no way of posting a formatted league table using BBCode. Would it be possible - or even viable - to add some new entries to the site's MyCode library to allow posting an HTML-type table?
For instance, using specific MyCode entries the following BBCode tags would produce a simple league table which would be displayed as below:
Of course, the BBCode text can be simply edited in any text editor to display different numbers of rows and columns in the exact same way as in basic HTML.
The four MyCode entries would be as follows:
Perhaps, if this solution isn't suitable, the addition of a MyBB plugin to allow the posting of tables could be installed at root level?
For instance, using specific MyCode entries the following BBCode tags would produce a simple league table which would be displayed as below:
Code:
[table]
[tr]
[th colspan=4 bgcolor=#f0f0f0]Scottish Championship 2015-16[/th]
[/tr]
[tr]
[th][b]Pos.[/b][/th][th][b]Team[/b][/th][th][b]P[/b][/th][th][b]Pts[/b][/th]
[/tr]
[tr]
[td]1st[/td][td]Rangers[/td][td]22[/td][td]56[/td]
[/tr]
[tr]
[td]2nd[/td][td]Hibernian[/td][td]21[/td][td]48[/td]
[/tr]
[tr]
[td]3rd[/td][td]Falkirk[/td][td]23[/td][td]46[/td]
[/tr]
[/table]
Of course, the BBCode text can be simply edited in any text editor to display different numbers of rows and columns in the exact same way as in basic HTML.
The four MyCode entries would be as follows:
Code:
1
Name: TABLE
Regular Expression:
\[table\](.*?)\[/table\]
Replacement:
<table class="{option}" BORDER=1>$1</table>
------------------------
2
Name: TR
Regular Expression:
\[tr\](.*?)\[/tr\]
Replacement:
<tr class="{option}">$1</tr>
-------------------------
3
Name: TH
Regular Expression:
\[th(( width=\d+| colspan=\d+| rowspan=\d+| bgcolor=\#[a-f0-9]{6})*)\](.*?)\[/th\]
Replacement:
<td align=center style="padding: 0 10px 0 10px;" class={option} $1>$3</td>
-------------------
4
Name: TD
Regular Expression:
\[td(( width=\d+| align=(left|center|right)| colspan=\d+| rowspan=\d+| bgcolor=\#[a-f0-9]{6})*)\](.*?)\[/td\]
Replacement:
<td align=center style="padding: 0 10px 0 10px;" class={option} $1>$4</td>
Perhaps, if this solution isn't suitable, the addition of a MyBB plugin to allow the posting of tables could be installed at root level?