In article <
rl79f7dnv1fr39tvk...@4ax.com>,
First, the right tool for the job is an HTML table. That is what
a table is for, it relates lists in logical ways, it is a largely
visual device to group items of one kind in such a way that items
of another kind can be seen to be related. No other element can
quite do this job as well.
For a table, you would have service information in cells in a
left column and contact information in cells in the column to the
right, each contact would relate to a service on the same table
row.
Without an HTML table, you *could* (but should not) 'work it' all
sorts of other ways. You could even have a picture of a table, a
picture of a couple of lists side by side (before they wrapped),
you *could* (but should not) do what you are trying above in
various modified forms.
One modified form would be to put your two lists in a container
that has a width calculated to always fit the two lists in side
by side.
There are some tricky issues with lists when calculating widths
to do with that the bullet points or numbers that default appear,
appear in margin or padding space. Margins and paddings in modern
standard HTML docs are outside the *width* of an element. If you
specify a width, be it in any units for an element, any margins
and paddings and borders will be outside this. Queer stuff it
might seem but that is how it is for various reasons which we can
pass over. The point is that when going for a pair of lists side
by side that will never wrap as long as CSS is operational, you
need to be careful of all sorts of things.
The simplest way, perhaps is to avoid having to calculate too
much! How about:
.listingLeft {
float: left;
width: 50%;
padding: 0;
margin: 0;
background: #fcc;
list-style-type: none;
}
.listingRight {
float: left;
width: 50%;
background: #cfc;
padding: 0;
margin: 0;
list-style-type: none;
}
with
<ul class="listingLeft">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
<ul class="listingRight">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
or simpler even and might suit
.services {
float: left;
width: 50%;
padding: 0;
margin: 0;
list-style-type: none;
}
<ul class="services">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
<ul class="services">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
</ul>
But remember, if one of the list items is long and wraps in *its*
available width - and it gets longer as users up their text size
- it will throw the visual correspondence between the list items
in the two lists off! You could juggle till you go dizzy trying
to fix this but why bother when an HTML table has got inbuilt
magic to handle this correspondence?
--
dorayme