stylesheet "tab"?

K

Keith Wiley

I would like a layout in which there is a list of items, each of which is
a heading for a sublist of items, such that all the sublists are "tabbed"
to the same position, sort of like:

Black Items: cat, car, marker
Red Items: curtain, sofa
Orange Items: carpet

Presently, I have the whole thing inside a <P> with a "left" for the left
edge of the entire list, so that the list is indented under a more global
heading, but I can't figure out how to set a "left" for the individual
lists. I tried setting "left" inside a <SPAN>:

<P STYLE="left: 20px">
Black Item: <SPAN STYLE="left: 40px">cat, car, marker</SPAN>
</P>

But that didn't work. I figured out that I could push the lists over by
giving SPAN a left margin, but the margins don't line up on the different
lines of text, they are all spaced according to the width of the Color
word.

How do I do this?

Thanks.

________________________________________________________________________
Keith Wiley (e-mail address removed)
http://www.unm.edu/~keithw http://www.mp3.com/KeithWiley

"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
-- Edwin A. Abbott, Flatland
________________________________________________________________________
 
E

Eric Bohlman

I would like a layout in which there is a list of items, each of which is
a heading for a sublist of items, such that all the sublists are "tabbed"
to the same position, sort of like:

Black Items: cat, car, marker
Red Items: curtain, sofa
Orange Items: carpet

Presently, I have the whole thing inside a <P> with a "left" for the left
edge of the entire list, so that the list is indented under a more global
heading, but I can't figure out how to set a "left" for the individual
lists. I tried setting "left" inside a <SPAN>:

<P STYLE="left: 20px">
Black Item: <SPAN STYLE="left: 40px">cat, car, marker</SPAN>
</P>

But that didn't work. I figured out that I could push the lists over by
giving SPAN a left margin, but the margins don't line up on the different
lines of text, they are all spaced according to the width of the Color
word.

How do I do this?

Use a table. Seriously. What you're describing *is*, semantically, a
table, and thus it should be honestly marked up as such. Use styles, of
course, to specify the appearance of the table.

Offsets like "left" apply only to elements with a non-static "position"
property; since the position property isn't inherited, neither your <P> nor
your <SPAN> have it, and therefore the offsets won't do anything.
 
S

Sid Ismail

: I would like a layout in which there is a list of items, each of which is
: a heading for a sublist of items, such that all the sublists are "tabbed"
: to the same position, sort of like:
:
: Black Items: cat, car, marker
: Red Items: curtain, sofa
: Orange Items: carpet


Tabular data - so use Tables, my man. 'Tis is what is was designed for.

Sid
 
R

Richard

Keith said:
I would like a layout in which there is a list of items, each of which
is
a heading for a sublist of items, such that all the sublists are
"tabbed"
to the same position, sort of like:
Black Items: cat, car, marker
Red Items: curtain, sofa
Orange Items: carpet

You could use <div> as a pseudo tab formation.
Layout divisions side by side and the content will naturally fall into place
where you position the divisions.
But table usage would be the simplest way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top