Display 3 columns of same height with variable amount of data
I'm building a page full of hyperlinks which are gotten from querying a content management system, so the number of links is variable.
The requirements need me to display all the links over 3 columns and make it look presentable.
So at the moment I've got myself a Map<Category, Hyperlink> and when I display it at the开发者_运维知识库 moment its in one big list on the page.
Is there some way I can dynamically get my columns to flow into each other so that each column contains a similar number of hyperlinks?
Thank you.
The easiest way I can think of to do this is to put the links in to an unordered list, then set the style for each list item so that they are 33% of the available width and displayed inline.
You might try looking at the following sites:
- https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5268973.html
- http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks
The second one is the best one, in my opinion. I used it before when I had the same problem. It gives all the code, really nice illustrations and you can just copy the code free of charge. I think this is exactly what you are looking for.
精彩评论