I'm trying to conditionally render a table with 2 columns per row. This is what I've tried:
<table width="100%" cellpadding="0" cellspacing="10" border="0">
<apex:variable var="i" value="{!1}" />
<apex:repeat value="{!relatedTo.Sample__r}" var="sample">
<apex:outputText rendered="{!IF(MOD(i,2)=1,true,false)}">
<tr>
</apex:outputText>
<td><apex:OutputText value="{!sample.Id}"/></td>
<apex:outputText rendered="{!IF(MOD(i,2)=1,true,false)}">
</tr>
</apex:outputText>
<apex:variable var="i" value="{!i+1}"/>
</apex:repeat>
</table>
I'm getting this error while trying to save the template:
Error: The element type "tr" must be terminated by the matching end-tag "</tr>".
I know it's complaining about the conditional code that does not include the end tag but how do I resolve this?
<tr>
and</tr>
after every 2<td>
s. Not sure if my logic or the syntax is incorrect.<apex:repeat>
.