是否有一个jquery插件可以水平而不是垂直地列出列表项?(Is there a jquery plugin that columnizes list items horizontally rather than vertically?)

我正在寻找一个jquery插件或javascript将列表列表。 我见过Columizer ,这很棒,配置选项正是我需要的,除了它没有按照我需要的方向列出数据。

我的列表:

1. 2. 3. 4. 5. 6. 7. 8. 9.

我想要的Columizer行为:

1. 2. 3. 4. 5. 6. 7. 8. 9.

想要的Columizer行为:

1. 4. 7. 2. 5. 8. 3. 6. 9.

I'm looking for a jquery plugin or javascript that will columnize a list. I've seen Columizer, which is great and the configuration options are just what I need, except that it doesn't columnize data in the direction I need.

My list:

1. 2. 3. 4. 5. 6. 7. 8. 9.

Columizer behavior I want:

1. 2. 3. 4. 5. 6. 7. 8. 9.

Columizer behavior I don't want:

1. 4. 7. 2. 5. 8. 3. 6. 9.

最满意答案

你可以通过CSS实现这一目标。

假设列表是<ul> <li>格式:

{ display:inline-block; width:33%; }

或使用float:left; 然后明确:全部; 每三个人一次。

或类似的东西 - 在CSS中可能有大约十几种方法。

You could probably achieve this with CSS.

Assuming the list is in < ul>< li> format:

{ display:inline-block; width:33%; }

or use float:left; and then set clear:all; on every third one.

or something like that -- there's probably about a dozen ways to do this in CSS.

更多推荐