<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Customizing_the_look_and_feel_of_a_row_or_a_cell[ Search for &quot;&quot;]</title>
        <description></description>
        <link>http://xataface.com/wiki/index.php?-action=single_record_search&amp;-table=wiki&amp;page_id=%3D62&amp;-cursor=0&amp;-skip=0&amp;-limit=30&amp;-mode=list&amp;--subsearch=</link>
        <lastBuildDate>Thu, 23 May 2013 05:50:21 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Customizing_the_look_and_feel_of_a_row_or_a_cell</title>
            <link>http://www.xataface.com/wiki/Customizing_the_look_and_feel_of_a_row_or_a_cell</link>
            <description>&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page name&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;Customizing_the_look_and_feel_of_a_row_or_a_cell&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page id&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;62&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page title&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;Customizing_the_look_and_feel_of_a_row_or_a_cell&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Content&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;
&lt;h2 id=&quot;toc0&quot;&gt;How to customize the look and feel of elements in the list view&lt;/h2&gt;

&lt;h3 id=&quot;toc1&quot;&gt;Create a method in a delegate class&lt;/h3&gt;
&lt;p&gt;In the delegate class, the method &lt;em&gt;css__tableRowClass&lt;/em&gt; is implemented, like in this example :&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;class tables_journal_interventions {
function css__tableRowClass(&amp;amp;$record){
    if ( !$record-&amp;gt;val('fermeture')){
        return 'intervention_close';
    }
    else return '';
} 
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here the function tests a condition : is there a value in the field &lt;em&gt;fermeture&lt;/em&gt; ?&lt;/p&gt;


&lt;h3 id=&quot;toc2&quot;&gt;Add the class in a CSS stylesheet&lt;/h3&gt;
&lt;p&gt;Now the class is created in a CSS stylesheet.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;td.intervention_close {
        background-color: #FFE6E6 !important;
    } &lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is a class for each cell, the &amp;lt;td&amp;gt; tag. The &lt;em&gt;!important&lt;/em&gt;  attribute is added to be sure that this information has precedence over all the others. It is better to add this class in a &lt;a href=&quot;http://xataface.com/documentation/how-to/custom_javascripts&quot; onclick=&quot;window.open(this.href, '_blank'); return false;&quot;&gt;custom CSS stylesheet&lt;/a&gt;.&lt;/p&gt;


&lt;h3 id=&quot;toc3&quot;&gt;Remarks&lt;/h3&gt;
&lt;p&gt;Beware that some versions of IE don't respect the background-color property on the &amp;lt;tr&amp;gt; tag, so it is probably better to write:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
    tr.intervention_close td {
        background-color: #FFE6E6;
    }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;i.e. to apply the background color to the individual cells.&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Language&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;en&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</description>
            <author>Customizing_the_look_and_feel_of_a_row_or_a_cell</author>
        </item>
    </channel>
</rss>
