Following innovations introduced by QGis version
2.12 : as in Excel tables, now
you
can
control
the cells setting of the attribute table
of a layer .
Now you can apply
conditional rules on the format implementation of
the attribute table. To this end , open the
attribute table of a layer
. On the right, you will see a new
button for the conditional setting.
![](https://i0.wp.com/www.sigterritoires.fr/wp-content/uploads/2019/05/101.png?resize=556%2C609&ssl=1)
Click
on the button to open
the formatting panel.
![](https://i0.wp.com/www.sigterritoires.fr/wp-content/uploads/2019/05/102.png?resize=630%2C391&ssl=1)
You can format
a particular
column or the entire line by selecting
Field or Complete Line . For the field, you
must
indicate
which
is
the field where you want to apply
a
format condition.
To include a formatting
rule, click the New Rule button . Then, you will
get
the conditional rule configuration panel:
![](https://i0.wp.com/www.sigterritoires.fr/wp-content/uploads/2019/05/103.png?resize=630%2C392&ssl=1)
You can enter
a
name, but for now, it is used nowhere
.
The @value variable
represents the value of the cell. You can
type directly a condition, for example
@value> 3.0 or
open
the
condition assistant by clicking on the button ε
.
![](https://i0.wp.com/www.sigterritoires.fr/wp-content/uploads/2019/05/104.png?resize=630%2C390&ssl=1)
As in all
the classic expressions in QGis, you can
refer to other fields of the table. Once the condition is entered
, you control the setting in
form
associated
with the lower panel :
![](https://i0.wp.com/www.sigterritoires.fr/wp-content/uploads/2019/05/105.png?resize=630%2C393&ssl=1)
The drop-down menu presents
some
pre-established setting options.
You can control
the background colors and characters, add an icon
at
the beginning of the cell ( from the QGis characters ), and control the formatting
and the characters font.
For a single column you
can
enter
many
implementation
formatting rules. In the following example, the wave heights are
classified
in
three groups , each with a different formatting.. The column hour
is
classified
to put in evidence day and night .
![](https://i0.wp.com/www.sigterritoires.fr/wp-content/uploads/2019/05/106.png?resize=630%2C392&ssl=1)
Warning: the formatting is
saved in the QGis
project . If you
open the table in another project,
it is not taken into account.