Announcement

Collapse
No announcement yet.

Why did this code make my forum kaplode?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why did this code make my forum kaplode?

    I am trying to move the contents on my navbar and this is the code i have (95% of which is totally unchanged from the navbar template)

    Code:
     <!-- logo -->
    <a name="top"></a>
    <table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
    <tr>
     <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
     <td align="$stylevar[right]" valign="bottom" width="100%">
      <div style="background: #FFFF00; padding: 6px;" width="100%">
    <!-- Menu -->
      <if condition="$show['member']">
       <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
      </if>
      <if condition="$show['registerbutton']">
       <td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
      </if>
      <td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
      <td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
      <td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
      <if condition="$show['popups']">  
       <if condition="$show['searchbuttons']">
        <if condition="$show['member']">
        <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
        <else />
        <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
        </if>
        <td id="navbar_search" class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if></td>
       </if>
       <if condition="$show['member']">
        <td id="usercptools" class="vbmenu_control"><a href="$show[nojs_link]#usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>  
       </if>
      <else />  
       <if condition="$show['searchbuttons']">
        <td class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4">$vbphrase[search]</a></td>
        <if condition="$show['member']">
        <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
        <else />
        <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
        </if>
       </if>
       <td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a></td>
       <if condition="$show['member']">   
        <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td>   
       </if>   
      </if>
      <if condition="$show['member']">
       <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td>
      </if>
    <-- /Menu -->
     </div>
     </td>
    </tr>
    </table>
    <!-- /logo -->
    But since i was taking this from my navbar template, i thought it would work fine, but when i tried it, this is what happened:


    It seems to be increasing the height of the table to the same height as the header image and not putting its width all the way along, it should be as far along as the yellow bar and only slightly higher than the yellow bar. Could anyone please take the time to tell me why this isnt working as it should?

    Regards,

    James

  • #2
    Because you have a DIV inside a table cell which contains more table cells. Bad coding all around.

    A table cell cannot contain other cells unless they are in a new table first.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X