3

I have one list with 10 (li) elements. Those are displayed in single column.

If I fixed height of that list then how can I display it in two or three columns?

Jakub Hampl
  • 39,863
  • 10
  • 77
  • 106
Pradip
  • 1,317
  • 4
  • 21
  • 36
  • Here's a live example of how to do it in jquery: http://jsfiddle.net/EebVF/5 Using this jquery plugin: http://github.com/fzondlo/jquery-columns – newUserNameHere May 03 '14 at 14:30

4 Answers4

4

you can check this multiple column lists

Manoj
  • 5,542
  • 9
  • 54
  • 80
3

There is a CSS3 solution for that, but it's not widely implemented by browsers yet. See this example, using the CSS property column-count:

http://jsfiddle.net/hwzpy/

Currently only works in FF, Safari and Chrome though. Otherwise, you'll have to use javascript or divide the list up in two lists.

-edit- The float variant as linked in other answers is really neat, didn't know about that one.

Stephan Muller
  • 27,018
  • 16
  • 85
  • 126
1

You can do this really easily with the jQuery-Columns Plugin for example to split a ul with a class of .mylist into 5 columns you would do

$(document).ready( function () {
  $('.mylist').cols(5);
});

Here's a live example on jsfiddle

newUserNameHere
  • 17,348
  • 18
  • 49
  • 79
1

This question has been asked before. See discussion on html css - how to create multiple column list?. There is also a helpful A List Apart article that covers six methods for doing this.

Community
  • 1
  • 1
Wylie
  • 1,054
  • 2
  • 12
  • 20