Given my datatable:
Notice the word Atack . Is it possible to create a check that if this word is in the datatable it gets a different formatting? Ex: Make bold and the color is Blue.
I think you can create a style like this:
.atack {
background-image: none !important;
color: blue !important;
font-weight: bold;
width: 100%!imporant;
height: 100%!imporant;
}
And in the outputText that you want to modify puts the check:
styleClass="#{valor.toLowerCase().indexOf('atack')!= -1 ? 'atack':''}"
If you wanted to modify only the word atack
, you could then create a method in beam
and check if the value contains the word, it would not be a good practice to do this:
And in the datatable would add the check in the desired columns:
public String contemAtack(String val) {
//remova os espaços entre < b e < f e < /font e < /b
return val.replace("Atack", < b>< font color=#0080c0>Atack< /font>< /b>);
}
< h:outputText value="#{seuBeam.contemAtack(valor)}" escape="false" />