Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Column width of horizontal menu


Go to End


3 Posts   1856 Views

Avatar
peppe

Community Member, 1 Post

15 November 2007 at 12:15am

Hi

I'm trying to build a horizontal menu using a table:

<% if Menu(2) %>
<table class="mainmenu">
<tr>
<% control Menu(2) %>
<td width="???"><a href="$Link">$MenuTitle</a></td>
<% end_control %>
</tr>
</table>
<% end_if %>

However, I am unable to figure out how to determine the width for every column (<td width="???">), if I wanted to have the same width for every menu entry (without knowing the total number of menu entries...)

Can anyone give me a hint on this?

Thanks

Avatar
dio5

Community Member, 501 Posts

16 November 2007 at 12:15pm

Well, you shouldn't use tables for menus actually...

Why don't you use a ul or ol and float the li's or make them inline, that would be a more modern solution.

Avatar
Willr

Forum Moderator, 5523 Posts

16 November 2007 at 7:21pm

I agree with dio5, tables for the navigation! *shudder*. Using a List is a much more semantic way of doing that.