list view more than one at a time

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 15, 2008   (RSS)

By Chris_t - March 14, 2008

Hello all, been doing pretty good in CMS but today I ran into a problem. I need to display 3 results per row. I tried just removing the <br> still they all listed in a row one wide.
I then created a table to house the 3 ( yes I know div tags are the new thing but I have been doing tables to long to give up on them). By placing the <?php foreach ($listRows as $record): ?> before the start of the table and <?php endforeach ?> at the end of the main table they do display 3 across like I want but each row is 3 of the same data. and when I move the ?php endforeach ?> or add more it just returns line errors. please help I am sure it is a simple problem.

Thanks
Chris

Re: [ChrisTitchenal] list view more than one at a time

By Dave - March 14, 2008

I think you might want something like this:

<table ... >
<tr>

<?php foreach ($listRows as $record): ?>
<td> ... display record ... </td>

<?php $maxCols=3; if (++$count % $maxCols == 0): ?>
</tr><tr>
<?php endif ?>

<?php endforeach ?>

</tr>
</table>


What that does is print each result in a cell and start a new row every 3 cells (columns).

If that's not it, can you post an url to your testpage and a mockup of what you want it to look like?

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] list view more than one at a time

By Chris_t - March 14, 2008

Thanks Dave,

here is what they sent me and said make it look like that [url "http://www.vikings.com/Team.aspx"][font "Arial"]http://www.vikings.com/Team.aspx[/#0000ff][/url]

here is my current build http://www.ragefootball.com/playerList3.php



I need to format a few items and have a thumbnail



thanks for all you're advice it has been a real help



Chris