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
Shaan Khokhar 9Shaan Khokhar 9 

How to make first column excluded from apex repeat

Hi Everyone,

I am trying to make it so my html table has it so that it looks like this:

User-added image
However, currently it looks more like this:

User-added image

I know that the apex:repeat is causing the problem, would i be able to exclude the first column somehow?

Here's my table code:
<table id = "table" style="width:50%">
                <thead>
                    <tr>
                    <th title="Field #0"></th>
                    <apex:outputPanel rendered="{!anyHourlyRatePopulated}" layout="none">
                        <th title="Field #1">Services</th>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!anyHourlyRatePopulated}" layout="none">
                        <th title="Field #1">Hourly Rate</th>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!any2HourRatePopulated}" layout="none">
                        <th title="Field #2">2 Hour Rate</th>
                    </apex:outputPanel>
                    </tr>
                    </thead>
                <tbody>
                <apex:repeat value="{!qli}" var="opp">
                <tr>

                    <th scope ="row">Level 1</th>
                        <td>
                           L1 Hourly Rate Field
                        </td>
                    <td>
                        " L1 2 Hour Rate Field "
                    </td>
            
                </tr>
                </apex:repeat> 
                <apex:repeat value="{!qli}" var="opp">
                <tr>

                    <th scope ="row">Level 2</th>
                        <td>
                            "L2 Hourly Rate Field"
                        </td>
                    <td>
                       " L2 2 Hour Rate Field "
                    </td>
            
                </tr>
                </apex:repeat> 
            </tbody>

        </table>



 
Best Answer chosen by Shaan Khokhar 9
Maharajan CMaharajan C
Hi Shaan,

Try with the apex:variable:

Please refer the below code:
<table id = "table" style="width:50%">
                <thead>
                    <tr>
                    <th title="Field #0"></th>
                    <apex:outputPanel rendered="{!anyHourlyRatePopulated}" layout="none">
                        <th title="Field #1">Services</th>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!anyHourlyRatePopulated}" layout="none">
                        <th title="Field #1">Hourly Rate</th>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!any2HourRatePopulated}" layout="none">
                        <th title="Field #2">2 Hour Rate</th>
                    </apex:outputPanel>
                    </tr>
                    </thead>
                <tbody>
				<apex:variable var="count" value="{!1}"/>
                <apex:repeat value="{!qli}" var="opp">
                <tr>
					<apex:outputPanel rendered="{!count == 1}">
						<th scope ="row">Level 1</th>
					</apex:outputPanel>
                        <td>
                           L1 Hourly Rate Field
                        </td>
                    <td>
                        " L1 2 Hour Rate Field "
                    </td>
            
                </tr>
				<apex:variable var="count" value="{!count+1}"/>
                </apex:repeat>
				<apex:variable var="countvar" value="{!1}"/>
                <apex:repeat value="{!qli}" var="opp">
                <tr>
					<apex:outputPanel rendered="{!countvar == 1}">
						<th scope ="row">Level 2</th>
					</apex:outputPanel>
                        <td>
                            "L2 Hourly Rate Field"
                        </td>
                    <td>
                       " L2 2 Hour Rate Field "
                    </td>
            
                </tr>
				<apex:variable var="countvar" value="{!countvar+1}"/>
                </apex:repeat> 
            </tbody>

        </table>



Thanks,
Mahrajan.C