PHP control HTML Layout

Need a little help with a solution for this problem. I have a list of services that is generated as such:

<div class="row">
    <?php foreach( $entries as $s ) : ?>
    <?php require( dirname(__FILE__) . '/_index_DisplayService.php' ); ?>

    <?php endforeach; ?>
</div>

_index_DisplayService.php

<div class="grid-4">
    <div id="service-mobile-dev" class="service">   
        <div class="service-icon">
            <i class="icon-calendar"></i>
        </div>
    </div>
</div>

Now this is a grid-12 layout, so I need 3, grid-4 per row then new row. I think that a solution starts with moving the <div class="row"> below <?php foreach( $entries as $s ) : ?> looking something like this:

<?php foreach( $entries as $s ) : ?>
    <div class="row">
        <?php require( dirname(__FILE__) . '/_index_DisplayService.php' ); ?>
    </div>
<?php endforeach; ?>

This of course kicks everything to a single row. How do I go about generating 3 grid-4′s per row.

Thanks!

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories