Horizontal CSS menu in table rendering vertically

Discussion in 'CSS' started by jfoster, Jul 27, 2009.

  1. #1
    I have a submenu in a table that I want to display horizontally. I realize that using an ordered list is a better choice, but this is an OOTB control built into Kentico and I cannot change the tags used for the menu, only the CSS.

    In Firefox and IE8, it rendereds horizontally. However, in IE7 is is rendering vertically. How can I make it horizontal? Below is the html and css. You can see the result at www.jvallecorsa.com. I've tried using both float:left and display:inline on the tr tag to make it horizontal with no luck. :confused: Any help is appreciated!

    <table class="subCMSMenu">
    <tr>
    <td class="subNavItem">
    <img src="/images/navigation/firstsubnavbar.aspx" alt="Brainstorms" style="border-width: 0px;" />Brainstorms
    </td>
    </tr>
    <tr>
    <td class="subNavItem">
    <img src="/images/navigation/firstsubnavbar.aspx" alt="Portfolio" style="border-width: 0px;" />Portfolio
    </td>
    </tr>
    </table>



    .subCMSMenu
    {
    text-align:left;
    position:absolute;
    display:inline;
    }

    .subCMSMenu tr
    {

    text-align:left;
    margin:0px;
    padding:0px;
    display:inline;
    }

    .subNavItem
    {

    text-align:left;
    margin:0px;
    padding:0px;
    display:inline;

    }

    .subNavItem img
    {

    display:inline;


    }
     
    jfoster, Jul 27, 2009 IP
  2. ptalent

    ptalent Peon

    Messages:
    26
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this CSS
    .subCMSMenu tr {
    	text-align:left;
    	margin:0px;
    	padding:0px;
    	display:block;
    	float:left;
    }
    
    .subNavItem {
    	text-align:left;
    	display:block;
    	float:left;
    	width:150px;
    }
    Code (markup):
     
    ptalent, Jul 31, 2009 IP
  3. jfoster

    jfoster Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    same problem -- works in ie 8, but not in ie 7.
     
    jfoster, Aug 11, 2009 IP