Resource icon

Table style override 1.0.0

No permission to download

Codelizard

Member
Licensed customer
Codelizard submitted a new resource:

Table style override - bbCode that overrides the built in [TABLE] bbcode with more features

After upgrading from XF 1.5, I had more than 1100 threads that used a custom bbcode to make tables. They looked like this:

Code:
[TABLE="width:800px,text-align:center"]
[TR="bgcolor=grey"]
[TD="text-align:left,font-weight:bold"]
...
... etc ... etc

Well, the built in
bbcode did not handle that at all, and the raw text (no formatting at all) just showed in these threads. None of the table bbcodes i found could be easily switched to without manually updating a thousand+...

Read more about this resource...
 
Last edited:
So, basically, the values are CSS style settings, separated by a comma. I suppose a semicolon would work as well, but the plugin from xf 1.5 used commas, so that was my target. Oh, and during rendering, i do replace bgcolor with background-color ;) Just in case you were wondering.

Here's a working table:

Code:
[TABLE STYLE="width:800px,text-align:center"]
[TR="bgcolor=grey"]
[TD STYLE="text-align:left,font-weight:bold"] Cell 1 [/TD]
[TD STYLE="text-align:right,bcolor:green"] Cell 2 [/TD]
[/TR]
[TR="bgcolor=lightgrey"]
[TD STYLE="color:#ffffff"] Row 2 Cell 1 [/TD]
[TD STYLE="bgcolor:black"] Row 2 Cell 2 [/TD]
[/TR]
[/TABLE]

As you can see, the [TR=] is in the old format. I searched for the code that does the parsing into the children array, but in general the code completely ignored the TR tag with a STYLE= attribute, but parsed just the = well enough for me to use. So, the TRs differ from the TABLE and TD tags. If someone finds it, and its something i can override, id be happy to update the code. I just ran out of steam and needed to move on to the next issue.
 
Back
Top Bottom