PDA

View Full Version : </TABLE> ignored, but when commented out it's all screwed!


Johnny
04-01-06, 01:57 PM
ok, now this is really bizzare...

This is the contents of my global header -


<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/CondomMegaStore_01.jpg" alt="" height="155" width="750"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="174"><img src="images/CondomMegaStore_02.gif" alt="" height="27" width="174"></td>
<td background="images/CondomMegaStore_03.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="right">
<a href="/index.htm"><img src="/images/home-button.gif" alt="Condoms Home Page" height="12" width="38" border="0"></a> <img src="/images/menu-button-divider.gif" alt="" height="12" width="14"> <a href="/about.htm"><img src="/images/help-button.gif" alt="Condoms Help" height="12" width="34" border="0"></a> <img src="/images/menu-button-divider.gif" alt="" height="12" width="14"> <a href="/mm5/merchant.mvc?Screen=SFNT&Store_Code=condom"><img src="/images/shop-button.gif" alt="Condoms Shop" height="12" width="37" border="0"></a> <img src="/images/menu-button-divider.gif" alt="" height="12" width="14"> <a href="/contact.htm"><img src="/images/contact-button.gif" alt="Contact us about Condoms" height="12" width="63" border="0"></a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>


If you look carefully all the tables (4 of them) are opened and closed - there are no open tags going out of the header.

Here is the code that calls the header from each template page -

<html>
<head>
<mvt:item name="head" />
</head>

<mvt:item name="body">
<mvt:item name="hdft" param="global_header" />
<table border="0" cellpadding="2" cellspacing="0" width="100%" >

But here's the weird thing - If I change the border on the very first table to 1 then display the page the border goes around EVERYTHING - the entire page (see attached)

If I then view the code something strange has happened - the final </td></tr></table> tags from the header seem to have dispeared (or at least moved)...

At the end of the header code, after the line <a href="/index.htm"><img src="/images/home-button.gif"... there are clearly 3 </TABLE> tags, but if you view the page code it looks like this -

<a href="/contact.htm"><img src="/images/contact-button.gif" width="63" height="12" border="0" alt="Contact us about Condoms"></a></div></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="0" width="100%" >
There are now only 2 </TABLE> tags between that line and the 1st line of the body code!

However, if I actually comment them out in the global header then the whole page screws up completely!

So just what the heck is going on?!?!?! :confused:

Jimmy Cooper
04-02-06, 08:35 AM
Hi John,

I'm not an HTML wiz at all, but one thing you may want to look at is the HEAD tag item. See if there is any code in there that may be messing with things.

Another way to trouble shoot this would be to create a new blank test page in MIVA Merchant 5 and assign only the global header item. See how it displays there then start adding different page items, like product display, and see if any new additions is where it messes up. That could help eliminate other parts of the page that could be affecting this.

Johnny
04-02-06, 12:17 PM
good idea. I tried that and figured out what was wrong - my dumbass html editor was *adding* the last </table> tags itself when it reformatted the code! (it needed formatting as it was all over the place, making it difficult to match up the open/colse tags)

DesignExtend-MSI
04-02-06, 06:25 PM
And, a question... Why are you nesting so many tables?

Johnny
04-02-06, 06:50 PM
well the global header above, which draws the banner and menu bar, was done by someone else so I'm not guilty on that. But having said that I've gone table mad in the rest of the page with all those sidebars... :D

But I realise there is an absurd amount of tables in the main pages, mostly because I just added them in one at a time until I noticed they were everywhere.

Not really sure how to else to re-code it to get the same effect without tables... I assume from your question you can think of a better way?

Johnny
04-02-06, 06:55 PM
Actually, now I look at the header it does look a bit weird the way they've done it - I could probably rewrite it with just the one main table...

But still looking for ideas on the sidebars!

Johnny
04-03-06, 01:00 PM
Well I see the reason for the nested tables - the logo is made up of 3 graphics and if you make them into 1 table there is a thick white horizontal line between them... But I did manage to fix that by just having two tables...

but then I just thought "why not just have one graphic in 1 table?", and ended up with this new code - <table width="750" height="180" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="/images/condoms-banner.jpg" valign="bottom">
<div align="right">
<a href="/index.htm"><img src="/images/home-button.gif" height="12" width="38" border="0" alt="Condoms Home Page"></a>
<img src="/images/menu-button-divider.gif" height="12" width="14" alt="">
<a href="/about.htm"><img src="/images/help-button.gif" width="34" height="12" border="0" alt="Condoms Help"></a>
<img src="/images/menu-button-divider.gif" height="12" width="14" alt="">
<a href="/mm5/merchant.mvc?Screen=SFNT&Store_Code=condom"><img src="/images/shop-button.gif" width="37" height="12" border="0" alt="Condoms Shop"></a>
<img src="/images/menu-button-divider.gif" height="12" width="14" alt="">
<a href="/contact.htm"><img src="/images/contact-button.gif" width="63" height="12" border="0" alt="Contact us about Condoms"></a></div>
</td>
</tr>
</table>

Basically, it just has one cell, the graphic is the background, and the menu is just aligned bottom right.

Not sure why the logo designers didn't just do that in the first place instead of that over complicated nonsense at the top. Am I missing something? Are there any version compatibility issues that may make my shorter version display incorrectly, or some other subtle reason why this new code isn't a good idea...?