Relative Position (in a table cell) - Horizontal Right

This sample demonstrates a right-aligned horizontal main menu with relative position inside a table cell on the page.

The following settings are used for the main menu in the last section (i.e. MENU TREE FEATURES) of the configuration file (c_config.js):

// MAIN-MENU FEATURES
'horizontal', // ItemsArrangement ('vertical','horizontal')
'relative',   // Position ('relative','absolute','fixed')
'80px',       // X Position (values in CSS valid units- px,em,ex)
'0',          // Y Position (values in CSS valid units- px,em,ex)
true,         // RightToLeft display of the sub menus
false,        // BottomToTop display of the sub menus
...

Because the menu items (the LI elements) of a horizontal main menu are left-floated a horizontal main menu cannot be automatically right-aligned. You can manually achieve right alignment for a horizontal main menu by setting a X Position value that will produce an appropriate left offset for the main menu and will shift it to the right - e.g. in this example:

'80px',       // X Position (values in CSS valid units- px,em,ex)

Notes

  1. The table in this example has red background and 3px cellpadding applied so that you could notice it easily. You could nest the menu tree in any table cell on your page.

Download this sample

You can download the complete example or just see the configuration file and the images used for it.

Configuration file


Shortcuts and Related

Bookmark / Share