Problems with Menu in a Table Cell

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Problems with Menu in a Table Cell

Post by Justice »

This is a minor annoyance, but the Menu is positioned inside a table cell, and is center aligned inside the cell. However, the cell's width is larger than the menu width. Sometimes when the page is loaded, the menu fills in this blank space by expanding to fill the whole cell, but this looks awkward.

The main page is located here:

http://www.justiceknight.com

The effect seems to be random, so it may or may not show when you go there...

Any help fixing this problem would be greatly appreciated!

Advance apologies to Mozilla users, the site's alignment is still screwed up in that browser. I'm going to try to correct it over the weekend.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

I think I saw the effect, but only briefly (IE6/Win2k). Does the effect take place only as the page loads, or does it persist after the loading is finished?

A couple of things to note that may or may not influence the problem:

(1) Your table is in a <td> that has no </td> end tag.

(2) There appears to be a <b> tag in the menu's table cell that serves no apparent purpose, and it also has no end tag.

(3) As the sample on the website indicates, you cuold get "unexpected results" by embedding the menu in a table, although yours seems to work for the mst part. May I be so bold as to suggest that your page layout does not require the menu to be in a table cell? You could get the same layout by sing the menu's built-in positioning. Then, you wouldn't get any table/menu-reated weirdness. If you want to try that, but need help with position options, give a holler.

Hope that helps,

Kevin
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

</td> tag added.

<b> tag removed (remnant from recycled code).

As to using the menu in outside a table, I've tried to avoid doing that, since I use a general template, and pictures on the top of the page and layouts might upset the placement. When I used Milonic Menu version 3, it was in a static spot on the page, and that was sometimes troublesome.

The funniest thing is, this problem never occurs when I load the pages locally, which is why I'm surprised it happens on the web. The problem usually shows up only on first load. A reload almost always eliminates it.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Justice wrote:...As to using the menu in outside a table, I've tried to avoid doing that, since I use a general template, and pictures on the top of the page and layouts might upset the placement....
I see... makes sense then.
The funniest thing is, this problem never occurs when I load the pages locally, which is why I'm surprised it happens on the web. The problem usually shows up only on first load. A reload almost always eliminates it.
Odd indeed. Perhaps the addition of the </td> will fix it. Let us know.

Kevin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

If that doesn't and you can't find another solution, you might insert a single cell table centered and the exact size you want for the menu inside the cell in which you now have the menu and put the menu in it. Geesh, that sounds like one of those i know that you know that I know, lol. I know that's not the fixing what causes it, but it would do what you want.

Ruth
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

LOL! Yeah, I know all about those tricks. When you have a rotten wall, you stick a framed picture over it to hide it. :lol:

It seems to be working okay now. Even better, I fixed enough syntax errors to get the thing to display right in Mozilla (well, main page anyway). I'll just hope things work okay in Opera and Firebird.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Ruth, is it past your bed time... :?: :D
John
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Bed??? what's that? :o Sometime in the middle of the week, my pages snuck up on me, slipped handcuffs on a tied me to the chair. :lol:

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

jgillett wrote:Ruth, is it past your bed time... :?: :D
I don't think Ruth has a proper bed time. She's a late lurker, just like you are sometimes! ;)
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

Er...sorry guys, I just tried again, and the result is the same as before. Any other suggestions, other than just sucking it up and living with it?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

kevin3442 wrote:She's a late lurker, just like you are sometimes! ;)
But aren't we all? Of course, with my -0700GMT, this post will appear as 2200 (approx.) in the UK, so the appearance is nice...
John
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Justice, one thing I noticed is that you do not have a menuwidth listed for the one on the page in the table, that might help...I think it's about menuwidth=510; Also, just in case some browsers sort of overlook that width you could put in addition an itemwidth= for each item, just like the onbgcolor you have... it's somewhere around 40 for the two small ones and 60 - 65 for the others. onbgcolor=#whatever;itemwidth=40;"); and so on. Hope that helps, and ultimately, the surefire way is a table with no border, cellspacing=0 etc. center align, in there the exact width of the menu :)
Ruth
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

Alright, I'll give that all a shot...

Out of curiosity, is there any surefire way of measuring exactly how many pixels in length my menu will be, besides hack and guess? I plan on changing the words over time, so that will change the settings. ;)
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm sorry, I don't know anyway to do that except by guess and by golly. If you know the font size and how many pixels that will take up based on the letters then you could add to that the padding you have set for the items, the border width and put it together and get close. I know you're using a template but if the menu is always going to be in that cell ...sorry I don't know about templates never having used them... would it be hard to have the template have a separate table in that cell for the menu? But, I think that if you put the menuwidth, or even just item widths it will solve the problem about it filling the cell like that. I know without that it tends to do that in Netscape especially, but with it that seems to disappear. I'd keep up with the new menu downloads [always keeping the last good working version someplace] because little things are getting fixed as they go.


Ruth
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Yes, there are screen rulers that measure exactly, there are some nice ones now, and free trial ones to get you started. Do a google search some are pc and some are mac.

I can't measure because I can't see the outline box once it loaded.

But your menu is just under 65% width.

You could use screenposition="center"; top=107; menuwidth="65%"; itemwidth="100%";

With your menu scripts just under the body tag.

maz
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

The table cell in which the menu resides is fixed at a relative width of 70 percent of the available screen width, with a cellpadding of 2 between the 3 columns of the page. I can, of course, insert a table within that cell with little difficulty. It all comes down to just getting that doggone width measure right. 8)

I don't really want to mess with "itemwidth" because when I inserted that last time, Internet Explorer crashed on me - and also put the menu about a football field right of where it was before.

I'll get to work on hacking all this out tonight and let you all know where it goes.
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I think I see it, you have a top and left position, but your position is relative so you don't need them, because the menu will be relative to the table not top and left of the browser.

style=menuStyle;
alwaysvisible=1;
orientation="horizontal";
position="relative";
menuwidth="100%";
itemwidth="100%";

What is overfilter? I don't know why you need that.

Give it a try, because top and left was causing the crash.

Also use td align="center" and remove <center> </center>

maz
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks Maz for the info on screen rulers, never knew there were such things. I got a nice little one free and, I don't know why except maybe it's not being sold anymore, or it's out of date or something, but when I downloaded it includes the 'pro' version so I can change it's colors and such. :)

Ruth
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

WE HAVE A WINNER!

Thanks Maz, that solved the problem. Itemwidth was the only parameter needed to stretch the menu out to fill the table cell. Menuwidth I stuck in there just in case.

As far as overfilter, I'm a very lazy slacker. I merely copied verbatim the sample HTML script code in the demo HTML page and never really tinkered with any of the parameters. I figured, so long as things were working, don't touch!

In fact, after experimenting with the menu a tad, there appears to be a little cheat. I used the parameter itemwidth="10%", which shrunk the menu to the smallest size possible for the font size selected. This appears to be functioning in both Mozilla and IE 6. HTML files are being uploaded within the hour to reflect all the advice on all the pages. You can let me know how it goes by posting feedback here or on my board.

Note: Delayed due to FTP access being down all of tonight. :x
Justice
Advanced
Advanced
Posts: 12
Joined: Sun Jan 11, 2004 2:34 am

Post by Justice »

Files now uploaded. Let me know if it shows up right. *Crosses fingers*
Post Reply