I need to control the display of a list of items (<ul>
with <li>
's) by setting a height limit. Consider the following code:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
This will be displayed as:
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
I want it to be displayed like this:
Item 1 Item 4
Item 2 Item 5
Item 3 Item 6
Is there a way to achieve this without using tables or repeating the <ul>
tags?
I'm thinking of something like - <ul limit="3">
but I am open to setting limits based on height (i.e. <ul limit="60px">
)
The reason for needing this functionality is that the <li>
tags are generated dynamically.
I am working with Ruby on Rails - if accomplishing this with XHTML and CSS alone isn't feasible, is there a method in Rails to achieve this without cluttering the view?