473,796 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ordered List

Hello,

I have the following:

<ol id ="ol">
<li id="li1">item1 </li>
<li id="li2">item2 </li>
<ol>

Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
And can I make li1 Width = 20% and li2 Width = 80%?

How can I do this using CSS?

Thanks,
Miguel

Jun 3 '07
20 2929
shapper wrote:
>
<ol id ="ol">
<li id="li1">item1 </li>
<li id="li2">item2 </li>
<ol>

Is it possible to display the List Items on the horizontal
FYI, whatever method is used to make an ordered list horizontal, the
list marker (i.e. the number) won't be part of it.

--
Berg
Jun 4 '07 #11
In article <5c************ *@mid.individua l.net>,
Bergamot <be******@visi. comwrote:
shapper wrote:

<ol id ="ol">
<li id="li1">item1 </li>
<li id="li2">item2 </li>
<ol>

Is it possible to display the List Items on the horizontal

FYI, whatever method is used to make an ordered list horizontal, the
list marker (i.e. the number) won't be part of it.
At least if it has to be pretty and this can't be polished up
(but it is _a_ horiz ordered list with numbers and supplied by
the <ol>):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">

<title>ol and numbers horiz</title>

<style type="text/css">
* {margin:0; padding:0;}

ol {padding-left: 50px;}

li {

float:left;
margin-top: .2em;
margin-right: 1.3em;
padding-right: .4em;
padding-left: 0px;
border-right: 2px solid #666;
}

li.last {border-right: 0;}
</style>

</head>

<body>

<ol>
<li>Mask</li>
<li>Gun</li>
<li>Bank</li>
<li>Police</li>
<li>Court</li>
<li class="last">Ja il</li>
</ol>

</body>
</html>

--
dorayme
Jun 4 '07 #12
In article
<do************ *************** *******@news-vip.optusnet.co m.au>,
dorayme <do************ @optusnet.com.a uwrote:
In article <5c************ *@mid.individua l.net>,
Bergamot <be******@visi. comwrote:
shapper wrote:
>
Is it possible to display the List Items on the horizontal
FYI, whatever method is used to make an ordered list horizontal, the
list marker (i.e. the number) won't be part of it.
or nicer, really:

<style type="text/css">
* {margin:0; padding:0;}
ol {padding-left: 50px;}
li {
float:left;
margin-top: .2em;
margin-right: 2.3em;
padding-right: .4em;
}
</style>
</head>
<body>
<ol>
<li>Mask;</li>
<li>Gun;</li>
<li>Bank;</li>
<li>Police;</li>
<li>Court;</li>
<li>Jail</li>
</ol>
</body>
</html>

--
dorayme
Jun 4 '07 #13
dorayme wrote:
>
(but it is _a_ horiz ordered list with numbers and supplied by
the <ol>):
Try it in IE and see what happens.

--
Berg
Jun 4 '07 #14
Bergamot wrote:
dorayme wrote:
>(but it is _a_ horiz ordered list with numbers and supplied by
the <ol>):

Try it in IE and see what happens.
File that under "Wow this works great!*"
* except in MSIE

You have to admit that flipping * gets tiresome! Then you have to take a
simple and elegant solution a muck it with an IE-workaround.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 4 '07 #15
On 2007-06-04, dorayme <do************ @optusnet.com.a uwrote:
In article
<11*********** ***********@r19 g2000prf.google groups.com>,
"scripts.contac t" <sc************ *@gmail.comwrot e:
>On Jun 3, 7:56 pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?

use a UL and
display:inline-block;
or
float:left
on LIs

Perhaps you might give an example using these alternatives you
mention.

-HTML-

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>

-STYLE-

li {display:inline-block;border:1p x dotted gray}

This is not an ordered list. I asked because while the ul one is
quite straightforward , the <olone is just that more tricky to
get right, no? To get the numbers in too remember... and to look
reasonable.
If you change the display on li to anything other than display:
list-item, the list item markers (bullets for an <olnumbers of some
kind for a <ul>) should disappear.

If you float the list items but leave them as display: list-item, you
should keep the markers (according to CSS 2.1 9.7) although neither
Opera nor Konqueror do.

Firefox does but it doesn't put them in a particularly helpful place.

So yes a horizontal <olis not easy to do. Neither is a horizontal <ul>
if you still want the bullets.
Jun 4 '07 #16
In article <5c************ *@mid.individua l.net>,
Bergamot <be******@visi. comwrote:
dorayme wrote:

(but it is _a_ horiz ordered list with numbers and supplied by
the <ol>):

Try it in IE and see what happens.
I take your word for it.

--
dorayme
Jun 5 '07 #17
In article <sl************ *********@bowse r.marioworld>,
Ben C <sp******@spam. eggswrote:
On 2007-06-04, dorayme
This is not an ordered list. I asked because while the ul one is
quite straightforward , the <olone is just that more tricky to
get right, no? To get the numbers in too remember... and to look
reasonable.


So yes a horizontal <olis not easy to do. Neither is a horizontal <ul>
if you still want the bullets.
Yes, I am sure you are right. I was thinking that it would be
unlikely for someone to be wanting the bullets in a horiz list.
But a little more liklihood wanting numbers for the ol one. I
assume that mostly people choose ol rather than ul for more than
some pure html semantic reason, they want the numbers!

They are a devil to code for with numbers and "border" separators
even in the browsers that show the numbers. When I messed about
with them, I found it simpler to forget about separators, beyond
perhaps a ";" after the text in each <li></li>.

I suppose I better fire up my Winbox and see what old Bergamot is
saying about IE. (I use him shamelessly to learn things, he does
not realise it, which is how I like it. But ssshhhh!)

--
dorayme
Jun 5 '07 #18
On 2007-06-05, dorayme <do************ @optusnet.com.a uwrote:
In article <sl************ *********@bowse r.marioworld>,
Ben C <sp******@spam. eggswrote:
>On 2007-06-04, dorayme
This is not an ordered list. I asked because while the ul one is
quite straightforward , the <olone is just that more tricky to
get right, no? To get the numbers in too remember... and to look
reasonable.


So yes a horizontal <olis not easy to do. Neither is a horizontal <ul>
if you still want the bullets.

Yes, I am sure you are right. I was thinking that it would be
unlikely for someone to be wanting the bullets in a horiz list.
But a little more liklihood wanting numbers for the ol one. I
assume that mostly people choose ol rather than ul for more than
some pure html semantic reason, they want the numbers!
Exactly. People quite often use display: inline on floated list-items to
lose the bullets. list-style: none (or something similar to that) is
also good but might not work in IE.
They are a devil to code for with numbers and "border" separators
even in the browsers that show the numbers. When I messed about
with them, I found it simpler to forget about separators, beyond
perhaps a ";" after the text in each <li></li>.
The spec doesn't define precisely where "outside" positioned list item
markers go so if you want to change the layout of the list much from the
normal vertical style it's probably better to do the numbers yourself
(in spans or something) and then you have more control over them.
Jun 5 '07 #19
In article <sl************ *********@bowse r.marioworld>,
Ben C <sp******@spam. eggswrote:
On 2007-06-05, dorayme <do************ @optusnet.com.a uwrote:
In article <sl************ *********@bowse r.marioworld>,
Ben C <sp******@spam. eggswrote:
On 2007-06-04, dorayme
They are a devil to code for with numbers and "border" separators
even in the browsers that show the numbers. When I messed about
with them, I found it simpler to forget about separators, beyond
perhaps a ";" after the text in each <li></li>.

The spec doesn't define precisely where "outside" positioned list item
markers go so if you want to change the layout of the list much from the
normal vertical style it's probably better to do the numbers yourself
(in spans or something) and then you have more control over them.
Yes. Or in a table for a very short ordered list (where wrapping
is unlikely to be an issue).

I once argued that an ordered list was in some sense equivalent
to a 2 col table, the left col containing the order and the right
the corresponding content, row by row, thus being tabular in its
heart of hearts. But any idea of presenting an ordered list in a
horizontal manner makes me think that a one row table would not
be an obviously helpful substitute. Because the logical
relationships between the cells with numbers and the cells with
corresponding content would be in pairs that are just a bit
harder to describe or be evident - "count in pairs from the first
cell", the voice reader pauses at the end of the pairs...

--
dorayme
Jun 6 '07 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
3918
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete value, usually as a <code>String</code>, or if an integral value as an <code>Integer</code>. <li>year as an <code>Integer</code> <li>month number as an <code>Integer</code>
210
10560
by: Christoph Zwerschke | last post by:
This is probably a FAQ, but I dare to ask it nevertheless since I haven't found a satisfying answer yet: Why isn't there an "ordered dictionary" class at least in the standard list? Time and again I am missing that feature. Maybe there is something wrong with my programming style, but I rather think it is generally useful. I fully agree with the following posting where somebody complains why so very basic and useful things are not part...
8
1674
by: Fuzzyman | last post by:
Sorry for this hurried message - I've done a new implementation of out ordered dict. This comes out of the discussion on this newsgroup (see blog entry for link to archive of discussion). See the latest blog entry to get at it : http://www.voidspace.org.uk/python/weblog/index.shtml Criticism solicited (honestly) :-) We (Nicola Larosa and I) haven't yet made any optimisations - but there
22
2376
by: bearophileHUGS | last post by:
>From this interesting blog entry by Lawrence Oluyede: http://www.oluyede.org/blog/2006/07/05/europython-day-2/ and the Py3.0 PEPs, I think the people working on Py3.0 are doing a good job, I am not expert enough (so I don't post this on the Py3.0 mailing list), but I agree with most of the things they are agreeing to. Few notes: - input() vanishes and raw_input() becomes sys.stdin.readline(). I think a child that is learning to program...
1
3334
by: rllioacvuher | last post by:
I need help with a program. I have implemented that following header file with an unordered list using one array, but i need to be able to use an ordered list and 2 arrays (one for the links and one to use as an index to the freearray cells). Here is the exact problem specifications: Create an ordered list template class named OLType to implement an ordered list with operations of insert, remove, print, empty, full, size. The storage...
5
14202
by: Lee Brotzman | last post by:
Hi, I have a sequence of data tables in an ordered list, like this: <ol> <li><table></table></li> <li><table></table></li> </ol> However it renders on the page with the list item number next to the
33
12224
by: Andreas Prilop | last post by:
To get bold numbers in ordered lists, one can write ol { font-weight: bold } ol span { font-weight: normal } <ol> <li><span>......</span></li> <li><span>......</span></li> </ol>
16
3669
by: some old html fumbler | last post by:
I want to use CSS to get an ordered list to start with something other than a 1 or equivalent. I have a list of things that happen during the course of a year. Too long a list is not helpful, so I only show maybe 3 months of items at a time. The items have to be ordered according to the year, IOW I can't list something in April as being #1. In HTML after the first couple of months I just use this sort of code: <ol start="14"...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.