--- comments: true date: 2010-02-11 23:44:02 layout: post slug: mutiple-column-lists-using-one-ul title: Multiple column lists using one <ul> wordpress_id: 701 categories: - Web Development tag: - CSS - HTML - Lists --- This is a quick, simple tutorial on how to create multiple column lists by only using one `ul`. Often is the case when you'd want multiple lists side-by-side, but you end up using markup like `
- CSS
- XHTML
- Semantics
- Accessibility
- Usability
- Web Standards
- PHP
- Typography
- Grids
- CSS3
- HTML5
- UI
And to make this into a multiple column list:
ul{
width:760px;
margin-bottom:20px;
overflow:hidden;
border-top:1px solid #ccc;
}
li{
line-height:1.5em;
border-bottom:1px solid #ccc;
float:left;
display:inline;
}
#double li { width:50%;} /* 2 col */
#triple li { width:33.333%; } /* 3 col */
#quad li { width:25%; } /* 4 col */
#six li { width:16.666%; } /* 6 col */
## When to use this
Use this wisely... It displays content in an ambiguous manner and should not be used where order of reading is imperative.
This method should only be used if the lists content doesn't require any specific ordering as the markup is written linearly and the list is displayed in a matrix. As you can see, the way the content is displayed means it can be read across»down»across or down»up»down. This means that the way you write your content is not necessarily the way it will be read. In [my example](/demos/multiple-column-lists/) this isn't an issue, as the content can safely be read in any order.