You need to sign in to do that
Don't have an account?
bohemianguy100
iterate horizontally using repeat
I'm trying to find a way to iterate over my content horizontally for three columns and once the three columns have been reached, the content moves to a new row.
I've tried using a panelGrid and repeat control and a combination or html markup and a repeat control, but I can't get the content to break into three separate columns.
Here is my VF page using html table and repeat control:
<apex:page standardController="Opportunity" extensions="SalesCoachActivityController"> <apex:form > <apex:outputPanel layout="block" style="overflow:auto;height:190px;"> <table cellpadding="10"> <tr> <apex:repeat value="{!Activities}" var="act"> <td> <apex:outputLink value="{!act.Content_URL__c}" target="_blank">{!act.Name}</apex:outputLink> </td> </apex:repeat> </tr> </table> </apex:outputPanel> </apex:form> </apex:page>
Is there a way to iterate over a list and display the content into three columns and then break into a new row once you reach the third column until all records have been displayed?
You can also do like this.
With the help of Java script and no controller.
In this example, I inserted data into table with Hyperlink alloted to it.
This table takes only 3 rows.
All Answers
There is no option for displaying the repeater data in no of columns.
If you want to achieve this have 2 or more repeaters in the output panel, Control the display of the additional repeaters and bind the data accordingly.
Do you have an example code snippet or perhaps a link to an example online?
Thanks.
Controller
You can also do like this.
With the help of Java script and no controller.
In this example, I inserted data into table with Hyperlink alloted to it.
This table takes only 3 rows.
Thanks for the help. Both methods worked as I needed. I appreciate both solutions!
Thank you!
How can I add image to that?