tr.even, tr.odd

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • romepatel
    New Member
    • Nov 2009
    • 31

    tr.even, tr.odd

    Hi,

    I have a table in my page, I want to give alternate effects to each row,
    so i have added tr.odd and tr.even in the styles sheet,

    Code:
    tr.odd {
    	margin-left: 5px;
    	padding-left: 5px;
    	padding-right: 5px;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	color: #000;
    	text-align:center;
    	background-color: #FEE8C7;
    	height: 20px;
    	padding-top: 3px;
     	cursor:pointer;
    }
    
    tr.even {
    	margin-left: 5px;
    	padding-left: 5px;
    	padding-right: 5px;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	color: #000;
    	text-align: center;
    	background-color: #ffffff;
    	height: 20px;
    	padding-top: 3px;
    	cursor:pointer;
    }

    Now styles are applied in Firefox, but its not applied in IE6

    Can some please help me out.

    Thanks in Advance
    Last edited by acoder; Dec 22 '09, 01:48 PM. Reason: Please use [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can set the styles which are the same for the element and the different style in the class:
    Code:
    tr {
        margin-left: 5px;
        padding-left: 5px;
        padding-right: 5px;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        color: #000;
        text-align:center;
        background-color: #FEE8C7;
        height: 20px;
        padding-top: 3px;
        cursor:pointer;
    }
    
    tr.even {
        background-color: #FFFFFF;
    }
    Show your HTML code. What doesn't work in IE6?

    PS. please make sure you use [code] tags when posting code.

    Comment

    Working...