Lots of these answers are outdated, it's 2020 and we shouldn't be enabling people who are still using IE9. It's way more simple to just use CSS grid.
The code is very simple, and you can easily adjust how many columns there are using the grid-template-columns
. See this and then play around with this fiddle to fit your needs.
.grid-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
}
_x000D_
<ul class="grid-list">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
_x000D_