Connecting Tech Pros Worldwide Help | Site Map

Format a list into multiple columns, or dynamically display columnsusing CSS?

Steve
Guest
 
Posts: n/a
#1: Jul 20 '05
I'm sure this question has been asked before, but I couldn't seem to get
the right combination of words to get a hit.

I'm looking to do one of two things...

1) Take a list of items, and have them display in a table format, but
without any predetermined number of columns. Meaning that somehow using
CSS tell the browser to determine the amount of screen space available,
and then adjust the list items into an appropriate number of columns,
all lined up nice and pretty.

2) Similar to #1, take a list of items, and display them in a
predetermined number of columns.

If this is a FAQ, or documented in the CSS spec, please just point me to
the proper links and I'll take care of the rest of the reading myself.

Thanks,
Steve
Jukka K. Korpela
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Format a list into multiple columns, or dynamically display columnsusing CSS?


Steve <ngroups@digitalnothing.com> wrote:
[color=blue]
> I'm sure this question has been asked before, but I couldn't seem to
> get the right combination of words to get a hit.[/color]

Try "multiple columns" (with quotation marks), in c.i.w.a.stylesheets
(since this is about appearance, is it not?).
[color=blue]
> 1) Take a list of items, and have them display in a table format, but
> without any predetermined number of columns.[/color]

The usual approach is basically
li { float: left; }
together with setting some reasonable width for the li elements (e.g.,
width: 8em if the longest item is less than about 20 characters).
But the topic really belongs to c.i.w.a.stylesheets.

(In HTML, the closest you can get, I presume, is to write the list items
just consecutively, just with spaces between them, with no list markup,
and pad them to the same number of characters using no-break spaces as
needed, and using e.g. <tt> markup to make the font monospaced. For some
more notes, and examples, see
http://www.cs.tut.fi/~jkorpela/HTML3...tml#menus-nbsp
This is of course a fairly clumsy method.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Closed Thread