Best Way To Display Two Columns List

Hi, forum!

I’m learning yii so it’s newbie question. Excuse me if I’m asking it wrong way :)

Say, I have categories and unknown number of subcategories. What’s the best way to display subcategories in two columns, side by side, all in one div? Is there any automatic way that can handle the calculation of number of rows for me?

See attached picture for details of what I’m trying to create.


CMenu with a simple css: demo or CListView (with similar css) if it is not a menu.

This can be solved by CSS only.

Basically, you assign {float: left; width: 50%;} to every list item, and the job is done :)

(also you’ll need to add a parent element and clearfix after that, but you got the idea).

Thank you, Argent and ORey! I’ll be using CListView with suggested css.

Is there any way to disable summary for CListView? I don’t want that ‘total’ information.

I think you can do it by setting template property.

OK, found that. Just had to set summaryText as false. Sorry for the noise, I need more coffee :)