BB Code For Tables
Here's how I made the bb code in the
BB Code Manager:
[table%] = <div><table width={option}>{param}</table></div>
[tr] = <tr>{param}</tr>
[td%] = <td width={option} valign = "top">{param}</td>
[td] = <td valign = "top">{param}</td>
Be sure to set "Use {option}" to yes where appropriate and "Disable BB Code Within This BB Code" to no.
These tags work fine (except as noted in my previous post) so long as you use them
properly. But as one of my forum members was quick to demonstrate, you can make a mess of thread layout if you don't close all the tags. I solved the problem with a template modification, which I'll describe in my next post.
--------------- Added [DATE]1259818896[/DATE] at [TIME]1259818896[/TIME] ---------------
Template Modification
To solve problems caused by improper use of my table tags I created a
cordon sanitaire to prevent the html from the bb code from messing up the thread layout. All it is is a table around the message area. Any unclosed table tags within a table cell are not executed.
To create the
cordon sanitaire go to the postbit template and scroll down about 40% to find this:
<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]
</div>
<!-- / message -->
Place the
following modifications above and below as follows:
<table cellpadding = "0" width ="100%">
<tr>
<if condition="$show['moderated']">
<td class="alt2" width="100%" id="td_post_$post[postid]">
<else />
<td class="alt1" width="100%" id="td_post_$post[postid]">
</if>
<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]
</div>
<!-- / message -->
</td></tr>
<tr>
<if condition="$show['moderated']">
<td class="alt2" width="100%" id="td_post_$post[postid]">
<else />
<td class="alt1" width="100%" id="td_post_$post[postid]">
</if>
Now scroll about 90% down and
modify as follows:
<!-- / controls -->
</div>
</td></tr></table>
<!-- message, attachments, sig -->
</td>
</tr>
</table>
$template_hook[postbit_end]
--------------- Added [DATE]1259819120[/DATE] at [TIME]1259819120[/TIME] ---------------
Quote:
Originally Posted by Lynne
There is actually another thread about this exact issue. I don't remember what the solution was, but you may want to do a search for it.
|
Oops, my bad! I'll have a look. Thanks.
--------------- Added [DATE]1259896866[/DATE] at [TIME]1259896866[/TIME] ---------------
I think this is the thread you were referring to:
https://vborg.vbsupport.ru/showthrea...ighlight=table.
It doesn't actually offer a solution but directs to
BB Code [table], which isn't quite what I want.
Still looking for help!