-
Notifications
You must be signed in to change notification settings - Fork 57
Customizing the look and feel of a row or a cell
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 ?
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.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 {
background-color: #FFE6E6&#59;
}
i.e. to apply the background color to the individual cells.