With the following HTML, what is the easiest method to display the list as two columns?
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
</ul>
Desired display:
A B
C D
E
The solution needs to be able work on Internet Explorer.
I was looking at @jaider's solution which worked but I'm offering a slightly different approach that I think is more easy to work with and which I've seen to be good across browsers.
By default un-ordered list display the bullet position outside but then in some browsers it would cause some display problems based on the browser's way of laying out your website.
To get it to display in the format:
etc. use the following:
This should solve all your problems with displaying columns. All the best and thanks @jaider as your response helped to guide me to discover this.
This is the simplest way to do it. CSS only.
With Bootstrap... This answer (https://stackoverflow.com/a/23005046/1128742) got me pointed towards this solution:
http://jsfiddle.net/patrickbad767/472r0ynf/
I like the solution for modern browsers, but the bullets are missing, so I add it a little trick:
http://jsfiddle.net/HP85j/419/
Thisd was a perfect solution for me, looking it for years:
http://css-tricks.com/forums/topic/two-column-unordered-list/
In
updateColumns()
needif (column >= columns.length)
rather thanif (column > columns.length)
to list all elements (C is skipped for example) so:http://jsfiddle.net/e2vH9/1/