Q:

Change the color of the rows in the table

I need to change the color of the row in the table to red if the school.student_to_teacher_ratio__c is less than 5 or else the default color should be green. How do I do that?
<apex:outputPanel id="school">
<apex:pageblock title="School Details">
  <apex:pageblockTable value="{!slist}" var="school">
       <apex:column value="{!school.name}" headerValue="School Name"/>

       <apex:column value="{!school.No_of_Students__c}" headerValue="No of Students"/>

       <apex:column value="{!school.No_of_Teachers__c}" headerValue="No of Teachers"/>

       <apex:column value="{!school.Student_to_Teacher_ratio__c }" headerValue="Student to Teacher ratio"/>

    </apex:pageblockTable>
</apex:pageblock>
</apex:outputPanel>

A:

You can use style attribute for the column cell as:
<apex:column value="{!school.Student_to_Teacher_ratio__c }" 
        headerValue="Student to Teacher ratio"
        style="{!IF(school.Student_to_Teacher_ratio__c>70,'background-color:green;',background-color:red;')}"/>

style applied on column tag always applied to its cell not header.

