Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Best 'Columns' List Approach
Old 01-23-2011, 11:59 AM Best 'Columns' List Approach
Angelosanto's Avatar
Webmaster Talker

Posts: 554
Name: Danny Angelosanto
Trades: 0
Hi, I'm trying to create a list (a big one) to be split into three columns whilst still remaining only one list, and also with the list items going down rather than across. Example:

LI 1 LI4 LI7
LI 2 LI5 LI8
LI 3 LI6 LI9

As opposed to:

LI 1 LI2 LI3
LI 4 LI5 LI6
LI 7 LI8 LI9

The only way I've come up with so far is by using different classes for each column, but I can't help feel there's a less complicated way to achieve this.

Any help would be great.

P.S. This is the first time I've seen the re-branded site - does anyone else think the new theme has pulled focus away from what is really great about this site? i.e. providing great advice on all aspects of design as opposed to focussing on the so-called 'entrepreneurs' of the web? I dunno, I can just see the new branding moving us closer towards a 'Digital Point' kind of community, which would of course be devastating. Sorry for the ramble, I was away for the big change!
__________________
"Those who believe in telekinetics, raise my hand."
-Kurt Vonnegut
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
 
Register now for full access!
Old 01-24-2011, 03:06 AM Re: Best 'Columns' List Approach
Angelosanto's Avatar
Webmaster Talker

Posts: 554
Name: Danny Angelosanto
Trades: 0
Hmm not sure I quite get what you mean...
__________________
"Those who believe in telekinetics, raise my hand."
-Kurt Vonnegut
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 01-24-2011, 12:08 PM Re: Best 'Columns' List Approach
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Um, did you just answer your own post?

The only way I have ever done a multi-column list while using only one ul is with this float method:

Code:
ul { width:600px; }
ul li { width:200px; float:left; }
This code would create 3 columns, each 200px wide. Though, not in the order you want.

As you can see, the "width" of the li must be an equal dividend of the the ul width. It can be any number of columns.

There may be other methods but this one always worked for me.

Last edited by racer x; 01-24-2011 at 12:09 PM..
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 01-24-2011, 12:16 PM Re: Best 'Columns' List Approach
Angelosanto's Avatar
Webmaster Talker

Posts: 554
Name: Danny Angelosanto
Trades: 0
Hey, thanks for the reply. I am aware of this method, and was looking for something that would order my items correctly. Is there really no easy way to do this using only one list?

And btw no I didn't answer my own post - a post was deleted that just had gobbledegook all over it
__________________
"Those who believe in telekinetics, raise my hand."
-Kurt Vonnegut
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 01-24-2011, 12:41 PM Re: Best 'Columns' List Approach
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Quote:
And btw no I didn't answer my own post - a post was deleted that just had gobbledegook all over it
Ha, I didn't see the removed post! Sorry. I didn't think you were nuts!

Is this list being populated by a database dynamically or is it hard coded?
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 01-24-2011, 12:55 PM Re: Best 'Columns' List Approach
Angelosanto's Avatar
Webmaster Talker

Posts: 554
Name: Danny Angelosanto
Trades: 0
It's a pure and simple HTML list of every country in the world (more or less)

There is no scripting or databasing of any kind going on. Kinda surprised cos the more I look around for a solution, the more there doesn't really seem to be one. Like I said before, the only thing I have seen that will work is to assign different class names to each third of the list
__________________
"Those who believe in telekinetics, raise my hand."
-Kurt Vonnegut
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 01-24-2011, 01:42 PM Re: Best 'Columns' List Approach
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
cannot be done with CSS you will have to re-order the list items server-side.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-24-2011, 03:02 PM Re: Best 'Columns' List Approach
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Maybe I am not understanding why it needs to be "one" list? I assume by "one list" you mean 3 columns within one <ul>?

If you are hard-coding why not just make 3 <ul> lists broken into equal lengths, then float each ul with a defined width? No classes needed at all unless you can't target from the parent div or something.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 01-24-2011, 03:32 PM Re: Best 'Columns' List Approach
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Here's a solution using jQuery - http://codeasily.com/jquery/multi-co...st-with-jquery

or, pure css - http://rickbjarnason.com/creating-mu...sts-using-css/
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-24-2011, 03:36 PM Re: Best 'Columns' List Approach
Angelosanto's Avatar
Webmaster Talker

Posts: 554
Name: Danny Angelosanto
Trades: 0
Ok, well thanks for the help guys, I think I'll either assign classes or go server-side
__________________
"Those who believe in telekinetics, raise my hand."
-Kurt Vonnegut
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Reply     « Reply to Best 'Columns' List Approach
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 2.09521 seconds with 12 queries