If for you don't care about the vertical order, but only the layout:
1. 2. 3. 4.
5. 6. 7. 8.
9. 10. 11. 12.
You can simply set the li elements this way:
li {
display: block;
width: 25%;
float: left;
}
It should work. If you need to have them in vertical order you need to act in the php script dividing them into separate divs and then float them.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…