I have a database query that returns an IList with 12 results in it. Each result is a link and I would like to format my results so that I get 4 lists of 3 results side by side, kind of like this:
item1 item4 item7 item10
item2 item5 item8 item11
item3 item6 item9 item12
Also, I cannot just hard code it into an because the query results could range from 4 to 16. All I know is I want 4 columns and I want to co in ascending order filling in the first column, then the second, then the third, and finally the fourth.
If you’re just looking for the HTML and CSS, try this:
HTML
CSS
Take note though that this won’t work in the event that any two items in a row (like item1 and item7) won’t have the same height.
So this won’t work when you have/need something like this:
If you’re looking for C# you could try something like this:
… you of course would need to still
<link>to the CSS.