Hello Thomas,
 
In my css-file I have:
tr.odd, tr.odd a {
    background-color: #eeeeee;
    color: #006666;
}

tr.even, tr.even a {
    background-color: #ccced1;
    color: #003333;
}

The code of my datatable is:
 
<t:dataTable
    value="#{managedBean.collection}"  var="item" 
    rowClasses="odd, even">
 
   <t:column width="120">
        <h:outputText value="#{item.description}" />
   </t:column>    
</t:dataTable>
 
When I open the page in a browser and look at the generated HTML is looks like:
 
<table>
 <tbody>
  <tr class="odd"> <td width="120">Value 1</td></tr>
  <tr class="even"><td width="120">Value 2</td></tr>
  <tr class="odd"> <td width="120">Value 3</td></tr>
 </tbody>
</table>

( I did clean up the HTML manually for readibility prior to posting it)
 
So my advice would be:
1) Put the probler classname in the rowClasses attribute and open the page in a 
browser.
        Check if the source of the page to see if the rendered HTML is correct 
and contains your classes at the appropreate rows.
2) If so: The problem is probably in your stylesheet: 
        Copy the HTML for 1 table with the proper classes to a static 
HTML-file, link your stylesheet to it and view the static HTML in a browser.
        Change your css so that it works and afterwards check if the JSF 
generated page also looks fine.
 
 
Good luck!
 
With kind regards,
    Marco
 
 
 

________________________________

From: Thomas Chang [mailto:[EMAIL PROTECTED] 
Sent: dinsdag 23 januari 2007 12:37
To: MyFaces Discussion
Subject: RE: Question about using dataTable


Hi Marco,

I defnie the "classForOddRows" in my css file as follow:

table-odd-row{background-color: #F1F1F1;}
table-even-row{background-color: #eeeeee;}

But it dosen't work.

Is my code wrong?

Thanks

Thomas




---

"Beelen, Marco" <[EMAIL PROTECTED]> schrieb: 

        Hello Thomas,
         
        Add the attribute rowClasses to the datatable with two comma-seperated 
classname for the odd and even-rows.
         
        
        <t:dataTable 
            value="#{collection}" var="varName" 
            rowClasses="classForOddRows, classNameForEvenRows">
        
            .....
            .....
        </t:dataTable>
        With kind regards,
            Marco
         

________________________________

        From: Thomas Chang [mailto:[EMAIL PROTECTED] 
        Sent: dinsdag 23 januari 2007 11:03
        To: MyFaces Discussion
        Subject: Question about using dataTable
        
        
        Hi,
        
        How can I configue the dataTable so the even number and odd-number line 
has different background color?
        
        Thomas
        
________________________________

        Der neue Internet Explorer 7 in deutscher Ausführung ist da 
<http://de.rd.yahoo.com/evt=44263/*http://de.downloads.yahoo.com/internetexplorer/index.php>
 ! 
        
------------------------------------------------------------------------------
        Notice:  This e-mail message, together with any attachments, contains
        information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
        New Jersey, USA 08889), and/or its affiliates (which may be known
        outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
        and in Japan, as Banyu - direct contact information for affiliates is
         
        available at http://www.merck.com/contact/contacts.html) that may be 
        confidential, proprietary copyrighted and/or legally privileged. It is 
        intended solely for the use of the individual or entity named on this 
        message. If you are not the intended recipient, and have received this 
        message in error, please notify us immediately by reply e-mail and then 
        delete it from your system.
        
        
------------------------------------------------------------------------------


________________________________

Keine Lust auf Tippen? Rufen Sie Ihre Freunde einfach an.
Yahoo! Messenger. Jetzt installieren 
<http://de.rd.yahoo.com/evt=39060/*http://de.messenger.yahoo.com> . 

------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

------------------------------------------------------------------------------

Reply via email to