function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kkaalkkaal 

Format single row in a PageBlockTable

I like the pageBlockTable as it allows me to create a SFDC style table and fill it with content easily.

Now I would need to format the cells or rows of that table depending on conditions. Something like set the background to red (of a cell or row).

 

How could I do that?

Pradeep_NavatarPradeep_Navatar

 

 

Add a property ‘style’  in column of a pageblock table and change the color of the cell according to the condition in the controller.

 

For an Example :

 

Page :

<apex:pageblocktable>

<apex:column style=”{!colorcell}”>

<apex:inputfield value=”{!account.name}”/>

</column>

 

 

Controller :

Colorcell =’background-color:red"’;

 

Did this answer your question? if so, please mark it solved.