sauletasmiestas
sauletasmiestas

Reputation: 438

Formatting HTML list to add variable size space

Is there a way to put a "tab" symbol inside a list, so different length words will be formatted like a table:

For example

<li>Word1 <something> description111111111111</li>
<li>Word2222222 <something> description</li>

At the end it would look like this:

Word1            description11111111111
Word2222222      description

Is it possible?

Upvotes: 1

Views: 895

Answers (2)

jtheman
jtheman

Reputation: 7491

Use a SPAN tag, then position it absolute within the LI tag:

 <li>Column 1<span>Column 2</span></li>

CSS

li { position: relative } 
li span { position: absolute; left: 100px }

Upvotes: 1

Simon Martin
Simon Martin

Reputation: 4231

Check out the answer to this post which says:

It's much cleaner to use CSS. Try padding-left:5em or margin-left:5em as appropriate instead.

Upvotes: 0

Related Questions