Skip to content

Customizing the look and feel of a row or a cell

Steve Hannah edited this page Sep 2, 2016 · 1 revision

Table of Contents

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 css__tableRowClass is implemented, like in this example :

class tables_journal_interventions { function css__tableRowClass(&$record){ if ( !$record->val('fermeture')){ return 'intervention_close'; } else return ''; } }

Here the function tests a condition : is there a value in the field fermeture ?

Add the class in a CSS stylesheet

Now the class is created in a CSS stylesheet.

td.intervention_close { background-color: #FFE6E6 !important; }

This is a class for each cell, the

tag. The !important attribute is added to be sure that this information has precedence over all the others. It is better to add this class in a custom CSS stylesheet.

Remarks

Beware that some versions of IE don't respect the background-color property on the

tag, so it is probably better to write:

tr.intervention_close td &#123&#59; background&#45&#59;color&#58&#59; &#35&#59;FFE6E6&#59&#59; &#125&#59;

i.e. to apply the background color to the individual cells.