Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Column width of horizontal menu

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

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

Page: 1
Go to End
Author Topic: 1441 Views
  • peppe
    Avatar
    Community Member
    1 Post

    Column width of horizontal menu Link to this post

    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

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Column width of horizontal menu Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Column width of horizontal menu Link to this post

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

    1441 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.