Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 12-03-2009, 03:31 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Table Trouble: White space above table

White Space Above Table

I've recently made some bb code tags to create tables. I'll go into the details later (in the next two posts), but for now I have a question. The bb code works for the most part but if you type the tags in as below you get a white space above the table:
[table%="100%"]
[tr]
[td%="15%"]AAAAAA
AAAAAA
AAAAAA[/td%]
[td]BBBBBB
BBBBBB
BBBBBB[/td]
[/tr]
[/table%]
Here's the source code created by the bb code:
<div><table width=100%><br />
<tr><br />
<td width=15% valign = "top">AAAAAA<br />
AAAAAA<br />
AAAAAA</td><br />
<td valign="top">BBBBBB<br />
BBBBBB<br />
BBBBBB</td><br />
</tr><br />
</table></div>
Notice all the line breaks caused by stacking the tags and content. Except for the ones inside the cell text, they don't do anything inside the table but instead are puked up above the table creating the white space.

Alternatively if you type in the code as follows you don't get the line breaks and the table comes out as planned:
[table%="100%"][tr][td%="15%"]AAAAAA
AAAAAA
AAAAAA[/td%][td]BBBBBB
BBBBBB
BBBBBB[/td][/tr][/table%]
So this is my question: How do I get rid of all the line breaks so I don't get the white space?
Reply With Quote
  #2  
Old 12-03-2009, 03:34 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 12-03-2009, 03:35 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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!
Reply With Quote
  #4  
Old 09-05-2014, 02:24 PM
webmastersun's Avatar
webmastersun webmastersun is offline
 
Join Date: Oct 2013
Location: www.webmastersun.com
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
.....................

It doesn't actually offer a solution but directs to BB Code [table], which isn't quite what I want.

Still looking for help!
Hey, today I research solution for this problem but not success and I tried BB code table existed in VB editor, it's great !!!
I applied to "advertise with us" page and it's give me what I want.
I sure more people searching for this problem
Solution is using BBCODE table

If allow HTML code in vb usergroup and forum manager, when insert a html table, we will have big space on top of table (reason vbulletin inserted more <br> tag on table automatically) and this didn't have a solution for it
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:22 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04017 seconds
  • Memory Usage 2,197KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete