Display several records in one row

Hello everyone,

I’m new to Yii and basically I want to create something like the attached picture.

Every page need 4 rows, 1 row contains 3 records from database. It also needs pagination at the bottom of the page.

What should I use here? I have tried to use CListView but cannot find out how to display several records in one row.

Any suggestions or references about this?

Thank you in advance.

Using CListView should do the job properly. You simply need to set the appropriate CSS so that the div’s will float.

Correct - although it may look like a table you should do this with a series of floated div’s.

Just make sure that each div is of the same width/height and is float: left and you should get the desired result.

Thanks! It works now.

I just would like to add that it seems we need to add ‘clear:both;’ to the pager class so that the pagination will be displayed correctly when: (the number of data in page) mod 3 != 0.

Hope this will help someone else.