You need to sign in to do that
Don't have an account?
dai tran 6
How can change step of apex:repeat?
I using apex:repeat to display a table image:
This my code:
i want display 4 image in a row,
How can to set step of apex:repeat=4?
This my code:
<table> <apex:repeat value="{!MyProducts}" var="row"> <tr> <td> <apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image> </td> </tr> </apex:repeat> </table>
i want display 4 image in a row,
How can to set step of apex:repeat=4?
Please try the below code. Hope it helps you.
<apex:page>
<apex:slds/>
<div class="slds-grid slds-wrap">
<apex:repeat value="{!MyProducts}" var="row">
<div class="slds-col slds-size_1-of-4">
<apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image>
</div>
</apex:repeat>
</div>
</apex:page>
Please mark it as best answer if it helps you.
Thank You,
Ajay Dubedi
All Answers
Create a map in the controller which contains potions like 1 ,2,3 ... and list of four images ..
Use repeat inside repeat with one TR ..
Please try the below code. Hope it helps you.
<apex:page>
<apex:slds/>
<div class="slds-grid slds-wrap">
<apex:repeat value="{!MyProducts}" var="row">
<div class="slds-col slds-size_1-of-4">
<apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image>
</div>
</apex:repeat>
</div>
</apex:page>
Please mark it as best answer if it helps you.
Thank You,
Ajay Dubedi
Some CSS not working,
Ex: <div align="center">
You can use CSS in these ways.
1) First Way is by using inline CSS.
// Here I have used a Style tag in div block itself. Please mark it as best answer if it helps you.
Thank You,
Ajay Dubedi
Can you give me link to get samples of slds?
Please refer below link for SLDS samples.
http://www.lightningdesignsystem.com/getting-started/
Thank You,
Ajay Dubedi
How can set [slds-size_1-of-4] auto by device?
Ex: Normal i set [slds-size_1-of-4]
if @media screen and (max-width: 1000px) : i set [slds-size_1-of-3]
if @media only screen and (max-width : 640px) { i set [slds-size_1-of-1]