[SalesForce] repeat rendered for certain condition

I'm using visalforce page and apex class for rendering the table on the browser.
I want to display 6 records per row. I have total 4 rows & 5 columns.
How I can use the repeat function to limit 6 records per row and remaining will be on next row.

<apex:repeat value="{!Appot}" var="string" id="Vers">
    <td class='tblSet'>
        <apex:outputText value="{!string}" id="T"/>
    </td>
</apex:repeat> 

From apex code I'm passing an array of Integer.

Thanks for help!

Best Answer

You can use apex:variable to iterate throught your data, and for each sixth element rerender break line

public class repeatCon {
    public String[] getStrings() {
        return new String[]{'one','two','three','four','five','six','seven'};
    }
}

<apex:page controller="repeatCon" id="thePage">
    <apex:variable var="i" value="{!0}"/>
    <apex:repeat value="{!strings}" var="string">
        <apex:variable var="i" value="{!i+1}"/>
            <apex:outputText value="{!string}"/>&nbsp;
            <apex:outputText value="<br/>" rendered="{!MOD(i, 3)==0}" escape="false"/>
    </apex:repeat>
</apex:page>

Output:

enter image description here