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
Admin User 10568Admin User 10568 

Error: "apex:outputPanel" must be terminated by the matching end-tag "</apex:outputPanel>".

Hi, 

Getting the following error: 

The element type "apex:outputPanel" must be terminated by the matching end-tag "</apex:outputPanel>".

For the following apex page: 

<apex:page standardController="REPRO__Project__c" extensions="ProjectAvailableONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "font-family: sans-serif; font-weight: bold; text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "font-family: sans-serif; text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
  
        <apex:pageBlockTable value="{!oncs}" var="onc" align="center" cellpadding="2" border="1"  style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;" >
              <apex:column headerValue="Level" value="{!onc.Property_Level__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                  <apex:column value="{!onc.Price_List_Property_Name__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /> 
                    <apex:column value="{!onc.REPRO__Type__c}" headerValue="Type" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                     
             <apex:column headerValue="Bdr" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bdr__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bdr__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
             
            <apex:column headerValue="Bath" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bth__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bth__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Study" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Study__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Study__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Internal Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Internal_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Internal_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="External Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__External_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__External_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
         
            <apex:column headerValue="Car" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Car__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Car__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
                <apex:column headerValue="List Price" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                    <apex:outputLabel value="{!onc.REPRO__List_Price__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                        <apex:outputField value="{!onc.REPRO__List_Price__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                            <apex:outputLabel value="Reserved" rendered="{!onc.REPRO__Status__c != 'Available'}"  />
                                </apex:column> 
            
        </apex:pageBlockTable>

    </apex:pageBlock> 
</apex:page>

// The intent is to make conditional formating within the apex table.

Any help would be awesome. 
Best Answer chosen by Admin User 10568
ShivankurShivankur (Salesforce Developers) 
Hi Admin, 

Thanks for posting the code snippet.

Try to check with below modified version of the same to see if you still see outputpanel end tag missing.
<apex:page standardController= "REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <table  border="4" align="center" cellpadding="4" style=" border-collapse: collapse; font-family: sans-serif; text-align: center; background-color:white;" >
   <tr style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;">
    <th>Level</th>    
    <th>Name</th>
    <th>Type</th>
    <th>Bdr</th>
    <th>Bath</th>
    <th>Study</th>
    <th>Internal Size m² </th>
    <th>External Size m² </th>
    <th>Car </th>
    <th>Price </th>
    </tr>    
     <apex:repeat id="myRepeatHeader" value="{!LevelList}" var="key">         
         <apex:variable var="count" value="{!1}"/>            
            <apex:repeat id="contactDetails" value="{!oncs[key]}" var="att">
                <tr>
                  <apex:outputPanel layout="none" rendered="{!count==1}">
                        <td rowspan="{!(modulecountMap[key])}"><apex:outputText value="{!att.Level}"/></td>
                    </apex:outputPanel>
              	
                    <td><apex:outputField value="{!att.Price_List_Property_Name__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
            		 <td><apex:outputField value="{!att.REPRO__Type__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
     				
             <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),'background-color: #A9A9A9;','')}" >
           				<apex:outputLabel value="{!att.REPRO__Bdr__c}" rendered="{att.REPRO__Status__c ='Available'}" />
                			<td value="{!att.REPRO__Bdr__c}" rendered="{!att.REPRO__Status__c = 'Available'}" />
                    </apex:outputPanel>
             
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Bth__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Bth__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Study__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Study__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Internal_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Internal_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__External_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__External_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
         
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Car__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Car__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
           	 <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
        			<apex:outputLabel value="{!att.REPRO__List_Price__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                 
                 //have to change the value to parse the list price through as currency. The map in the class changes it to  from currency to integer
                
                 <apex:outputText  value="{0, number, 000,000.00}"/>
                 <apex:param value="{!att.REPRO__List_Price__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
                			<apex:outputLabel value="Reserved" rendered="{!att.REPRO__Status__c != 'Available'}"  />
                
           
                    
                    </apex:outputPanel>
    

                </apex:variable var="count" value="{!count+1}"/>
                </tr>
                </apex:repeat>
                    
                </table>
                 
</apex:page>
The problem may be in the quotes. You should use single quotes within double-quotes. Since, you just need to evaluate as a string which is style and should work with it.

If it helps, Please mark as Best Answer so that it can help others in the future.

Thanks.

All Answers

ShivankurShivankur (Salesforce Developers) 
Hi Admin,

I see you don't have apex:outputPanel tag used in the provided VF page code.

Please post the complete/right code using 'Add a code sample' tool available in the editor tool. So that a correct suggestion can be provided.

Thanks.
Admin User 10568Admin User 10568
<apex:page standardController= "REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <table  border="4" align="center" cellpadding="4" style=" border-collapse: collapse; font-family: sans-serif; text-align: center; background-color:white;" >
   <tr style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;">
    <th>Level</th>    
    <th>Name</th>
    <th>Type</th>
    <th>Bdr</th>
    <th>Bath</th>
    <th>Study</th>
    <th>Internal Size m² </th>
    <th>External Size m² </th>
    <th>Car </th>
    <th>Price </th>
    </tr>    
     <apex:repeat id="myRepeatHeader" value="{!LevelList}" var="key">         
         <apex:variable var="count" value="{!1}"/>            
            <apex:repeat id="contactDetails" value="{!oncs[key]}" var="att">
                <tr>
                  <apex:outputPanel layout="none" rendered="{!count==1}">
                        <td rowspan="{!(modulecountMap[key])}"><apex:outputText value="{!att.Level}"/></td>
                    </apex:outputPanel>
              	
                    <td><apex:outputField value="{!att.Price_List_Property_Name__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
            		 <td><apex:outputField value="{!att.REPRO__Type__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
     				
             <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Bdr__c}" rendered="{att.REPRO__Status__c ='Available'}" />
                			<td value="{!att.REPRO__Bdr__c}" rendered="{!att.REPRO__Status__c = 'Available'}" />
                    </apex:outputPanel>
             
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Bth__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Bth__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Study__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Study__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Internal_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Internal_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__External_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__External_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
         
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Car__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Car__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
           	 <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
        			<apex:outputLabel value="{!att.REPRO__List_Price__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                 
                 //have to change the value to parse the list price through as currency. The map in the class changes it to  from currency to integer
                
                 <apex:outputText  value="{0, number, 000,000.00}"/>
                 <apex:param value="{!att.REPRO__List_Price__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
                			<apex:outputLabel value="Reserved" rendered="{!att.REPRO__Status__c != 'Available'}"  />
                
           
                    
                    </apex:outputPanel>
    

                </apex:variable var="count" value="{!count+1}"/>
                </tr>
                </apex:repeat>
                    
                </table>
                 
</apex:page>

Thanks @Shivankur see snippet. 
ShivankurShivankur (Salesforce Developers) 
Hi Admin, 

Thanks for posting the code snippet.

Try to check with below modified version of the same to see if you still see outputpanel end tag missing.
<apex:page standardController= "REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <table  border="4" align="center" cellpadding="4" style=" border-collapse: collapse; font-family: sans-serif; text-align: center; background-color:white;" >
   <tr style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;">
    <th>Level</th>    
    <th>Name</th>
    <th>Type</th>
    <th>Bdr</th>
    <th>Bath</th>
    <th>Study</th>
    <th>Internal Size m² </th>
    <th>External Size m² </th>
    <th>Car </th>
    <th>Price </th>
    </tr>    
     <apex:repeat id="myRepeatHeader" value="{!LevelList}" var="key">         
         <apex:variable var="count" value="{!1}"/>            
            <apex:repeat id="contactDetails" value="{!oncs[key]}" var="att">
                <tr>
                  <apex:outputPanel layout="none" rendered="{!count==1}">
                        <td rowspan="{!(modulecountMap[key])}"><apex:outputText value="{!att.Level}"/></td>
                    </apex:outputPanel>
              	
                    <td><apex:outputField value="{!att.Price_List_Property_Name__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
            		 <td><apex:outputField value="{!att.REPRO__Type__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
     				
             <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),'background-color: #A9A9A9;','')}" >
           				<apex:outputLabel value="{!att.REPRO__Bdr__c}" rendered="{att.REPRO__Status__c ='Available'}" />
                			<td value="{!att.REPRO__Bdr__c}" rendered="{!att.REPRO__Status__c = 'Available'}" />
                    </apex:outputPanel>
             
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Bth__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Bth__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Study__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Study__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Internal_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Internal_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__External_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__External_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
         
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Car__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Car__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
           	 <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
        			<apex:outputLabel value="{!att.REPRO__List_Price__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                 
                 //have to change the value to parse the list price through as currency. The map in the class changes it to  from currency to integer
                
                 <apex:outputText  value="{0, number, 000,000.00}"/>
                 <apex:param value="{!att.REPRO__List_Price__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
                			<apex:outputLabel value="Reserved" rendered="{!att.REPRO__Status__c != 'Available'}"  />
                
           
                    
                    </apex:outputPanel>
    

                </apex:variable var="count" value="{!count+1}"/>
                </tr>
                </apex:repeat>
                    
                </table>
                 
</apex:page>
The problem may be in the quotes. You should use single quotes within double-quotes. Since, you just need to evaluate as a string which is style and should work with it.

If it helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
This was selected as the best answer
Admin User 10568Admin User 10568
Hi @Shivankur, 

Updating the inner quotes has removed the error. There was a few more errors in the code too. But that certainly cleared the way to resolve the remaining errors.

Below example of the correct quotes.
<apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),'background-color: #A9A9A9;','')}" > <apex:outputLabel value="{!att.REPRO__Bdr__c}" rendered="{att.REPRO__Status__c ='Available'}" /> <outputField value="{!att.REPRO__Bdr__c}" rendered="{!att.REPRO__Status__c = 'Available'}" /> </apex:outputPanel>
Thanks for taking the time to help me here. Much apprectiated.