<?xml version="1.0"?>
<record><wiki id="wiki?page_id=62">
	<page_name>Customizing_the_look_and_feel_of_a_row_or_a_cell</page_name>
	<page_id>62</page_id>
	<page_title>Customizing_the_look_and_feel_of_a_row_or_a_cell</page_title>
	<content>==How to customize the look and feel of elements in the list view==

===Create a method in a delegate class===

In the delegate class, the method &apos;&apos;css__tableRowClass&apos;&apos; is implemented, like in this example :

&lt;code&gt;class tables_journal_interventions {
function css__tableRowClass(&amp;$record){
    if ( !$record-&gt;val(&apos;fermeture&apos;)){
        return &apos;intervention_close&apos;;
    }
    else return &apos;&apos;;
} 
}
&lt;/code&gt;

Here the function tests a condition : is there a value in the field &apos;&apos;fermeture&apos;&apos; ?

===Add the class in a CSS stylesheet===

Now the class is created in a CSS stylesheet.

&lt;code&gt;td.intervention_close {
        background-color: #FFE6E6 !important;
    } &lt;/code&gt;

This is a class for each cell, the &lt;td&gt; tag. The &apos;&apos;!important&apos;&apos;  attribute is added to be sure that this information has precedence over all the others. It is better to add this class in a [http://xataface.com/documentation/how-to/custom_javascripts custom CSS stylesheet].

===Remarks===

Beware that some versions of IE don&apos;t respect the background-color property on the &lt;tr&gt; tag, so it is probably better to write:

&lt;code&gt;

    tr.intervention_close td {
        background-color: #FFE6E6;
    }&lt;/code&gt;

i.e. to apply the background color to the individual cells. </content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki></record>