Menus and table cell centering

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
funkykeys
Advanced
Advanced
Posts: 10
Joined: Wed May 21, 2003 5:32 pm

Menus and table cell centering

Post by funkykeys »

Hi,

I've setup horizontal menus and am having a problem. Essentially, I'd like the primary menu links to center within a table cell, and without a static width for everything, since the client edits all menus/submenus through a Web-based admin and the lengths of chars will change often. It'd be great to have each primary menu link render with a preset space in between, rather than a static width for all items.

Is what I'm asking possible? Please check it out at http://iippc.projectphoenix.com/items.aspx and see what I've done toward the top of the page against the green bg.

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

Post by Ruth »

I'm not sure I understand. Are you saying you want the text in the item to be centered? Use the align="center"; parameter. If you are saying you want the 'mainmenu' to be centered in the table cell, what i always do is just make a nested table, put the menu in it and center the table. For example,

Code: Select all

<tr><td><center><table border="0" cellpadding="0" cellspacing="0" align="center"><tr><td>main menu</td></tr></table></center></td></tr>
I also use the 'center' tags as you can see. I never know what browsers to what with what, so I just put it all in.

Ruth
funkykeys
Advanced
Advanced
Posts: 10
Joined: Wed May 21, 2003 5:32 pm

Post by funkykeys »

Thanks, Ruth -- I figured it out. Reading the instructions always helps!

I just added the <script> tag in the centered cell and set the position parameter to "relative." Works great. :)
Thanks,
Scott
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Just to make sure on the directions for table placed menus, the only menu that should be in that table cell is the main menu. The submenus are supposed to be built/read before the main menu gets rendered. Usually, the submenus are put in their own file, either with the styles or the styles can be their own file also, and the main menu is either put in a file by itself and called in the table cell alone, or it is placed directly into the table cell. As you found, the main menu is then called in the cell in between script tags.

Ruth
Post Reply