0

I'm trying to create a layout like below

I have an object like this

[1]
[2]
[3]
[4]

But when i break these column into 2 columns i have this result https://jsfiddle.net/juh7fe8o/1/

[1] [3] 
[2] [4]

The expected result should be like this

[1] [2]
[3] [4]

How can i order these columns? All of my elements have a index that could be used

  • 1
    Does this answer your question? [How to display an unordered list in two columns?](https://stackoverflow.com/questions/14745297/how-to-display-an-unordered-list-in-two-columns) – Shimi Dec 03 '20 at 19:07
  • I think this is duplicated with https://stackoverflow.com/questions/14745297/how-to-display-an-unordered-list-in-two-columns – Shimi Dec 03 '20 at 19:07

2 Answers2

0

you may use grid instead column:

ul {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap: 20px;
}
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
    <li>Item 4</li>
</ul>
G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
0

You can use flexbox:

ul {
  display:flex;
  flex-wrap:wrap;
}
li {
  width:50%;
}
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
    <li>Item 4</li>
</ul>
nothing
  • 85
  • 8