How to theme main menu in three columns I have a main menu block which i am showing at top-navigation.
I need to theme main menu but not sure how to apply classes to the root level menu items and sub menus.

i tried below snippet but not getting result. Can anybody tell me how to achieve this.





   $main_menu,
  'attributes' => array(
  'id' => 'main-menu',
  'class' => array('links', 'navlist1', 'clearfix'),
  ),
  )); 
  ?>


Below is the screenshot image which output i want to show in main-menu
For a quick non-programmatic solution, you can consider using the Menu blocks module to render 2nd level menu items in 6 separate blocks, then render the blocks in the regions you want. On top of this you can also add customer classes on menu items with Menu attributes module.
If you don't mind a javascript approach, you can manipulate dom to move the sub menus around.
If you are familiar with the theme layer, you can create your custom theme function for main menu by implementing themename_links__system_main_menu.