473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to make sub-items of a list item?

What I'm trying to do is something like this:
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.

Can you help me please?

--
____________________________
geotso's stories
Be thou attentive!...

(Please, remove the TRAP to contact me)
Jul 20 '05 #1
13 7024
geotso wrote:
What I'm trying to do is something like this:
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.
<ol>
<li>
<li>
<li>
<ol>
<li>
<li>
<li>
</ol>
<li>
<!-- etc. -->
</ol>

with styles to suggest numbering. That might be a good starting
point. I don't know what the context is, so I can't offer more specifics.
Can you help me please?


Well, start with the spec, and you can help yourself. :)
http://www.w3.org/TR/html401/struct/lists.html

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2
In article geotso wrote:
What I'm trying to do is something like this:
Since we are in stylesheet group, I assume you already know how to markup
nested ordered list, and aim for exact look. (and if not, look source of
example.)
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.


Your example is inconsistant, I suppose "." in 3c is mistake? You need to
use counters. Works only on Opera 5+, but is possible to make it degrade
somewhat OK, I think.

Example:
http://www.iki.fi/lr/www/css/example...numbering.html
(tested on Opera 7.21)

References:
http://www.w3.org/TR/CSS21/generate.html
http://www.w3.org/TR/CSS21/syndata.html#counter

It might be better hardcode numbering. If it is really meaningful.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #3
Brian,

Thanks for your try, but I think it's not what I was asking for, and that's
my fault:
A common ordered list like the one you've posted, produces this result:

1
2
3
1
2
3
4
where the sub-items are indented under the item they belong.
I want the sub-items in the same vertical-alinment and numbered with the
same number, followed by a sub-count, like the one in my first post:
1
2
3a
3b
3c
4
etc.

Maybe you mean something by that "with styles to suggest numbering" that I
don't get it. Could you explain it a bit please?

Thanks again.

Brian wrote:
geotso wrote:
What I'm trying to do is something like this:
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.


<ol>
<li>
<li>
<li>
<ol>
<li>
<li>
<li>
</ol>
<li>
<!-- etc. -->
</ol>

with styles to suggest numbering. That might be a good starting
point. I don't know what the context is, so I can't offer more
specifics.
Can you help me please?


Well, start with the spec, and you can help yourself. :)
http://www.w3.org/TR/html401/struct/lists.html

Jul 20 '05 #4
Lauri Raittila wrote:
Since we are in stylesheet group, I assume you already know how to
markup nested ordered list,
you've guessed right!
Your example is inconsistant, I suppose "." in 3c is mistake?
Not exactly! I used that ". . . . . " part, just as a text replacement and
nothing more :)
You need to use counters. Works only on Opera 5+, but is possible to
make it degrade somewhat OK, I think.
hmm. I don't like it, because I want it for a IE specific project.
It might be better hardcode numbering. If it is really meaningful.


I think you've right again! I was looking for the easy way, but it doesn't
matter!
Thanks for your try!
Jul 20 '05 #5
geotso wrote on 30 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
I think you've right again! I was looking for the easy way, but it
doesn't matter!


Experimenting, I diverted from the topic and made this:

<script>var x=7</script>

<ol type="a">
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
</ol>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #6
Lauri Raittila <la***@raittila.cjb.net> wrote:
It might be better hardcode numbering. If it is really meaningful.


Yes, I'm afraid we need to wait for a few years before generated content and
automatic numbering are well enough supported.

Just to spell things out, hardcode numbering would best use simple
<ul> lists, nested when needed, and containing the numbers in the <li>
element contents. And CSS would be used just to suppress the default
bullets.

It's somewhat illogical to use <ul> when it's actually numbered, but the
risk of getting bullets is more tolerable than the risk of getting extra
numbers in front of the hardcode numbers (when CSS is disabled, or our
list-style-type is overridden by a user style sheet).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #7
Evertjan. wrote:
<script>var x=7</script>

<ol type="a">
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
</ol>


You know that this is invalid?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #8
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
Evertjan. wrote:
<script>var x=7</script>

<ol type="a">
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
</ol>


You know that this is invalid?


No

Depreciated yes.

Invalid, why?
What part is invalid, the qwerty?
Tested under IE6

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #9
Evertjan. wrote:
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:

Evertjan. wrote: [invalid HTML code]You know that this is invalid?

No

Depreciated yes.

Invalid, why?


E.g. ol elements cannot contains script elements.
What part is invalid, the qwerty?
You know how to validate HTML? Hint: <http://validator.w3.org/>
Tested under IE6


You know that testing in WinIE with its Mega Bytes of error recovery
routines is not a good method to test for correctness of code?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #10
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
E.g. ol elements cannot contains script elements.
What part is invalid, the qwerty?
You know how to validate HTML? Hint: <http://validator.w3.org/>


Yes, if that is your definition of "invalid" then you are right.
E.g. ol elements cannot contains script elements.


Perhaps according to the spec., but a document.write should not harm, IMHO.
I could include the <ol> in the document.write.

My only point was that it is possible to have a decrementing <ol> sequence.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #11
"Evertjan." <ex**************@interxnl.net> wrote in
news:Xn********************@194.109.133.29:
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
E.g. ol elements cannot contains script elements.
What part is invalid, the qwerty?


You know how to validate HTML? Hint: <http://validator.w3.org/>


Yes, if that is your definition of "invalid" then you are right.


When talking about HTML, "valid" and "invalid" are technical terms with
precise meanings. They're not subject to personal definitions. A valid
HTML document is one whose syntax conforms to the document type definition
(DTD) associated with its document type. An invalid HTML document is one
whose syntax doesn't conform. The question of whether or not the syntax
conforms is one that can be answered algorithmically, i.e. by a purely
mechanical process. Calling an HTML document "valid" or "invalid" is a
statement of fact, not a value judgment. People can hold differing
opinions on whether or not it's important for a document to be valid, but
not on whether or not a document *is* valid.
Jul 20 '05 #12
Evertjan. wrote:
You know how to validate HTML? Hint: <http://validator.w3.org/>


Yes, if that is your definition of "invalid" then you are right.


May I ask why you put "invalid"[1] in quotes?

[1]Yes, I realize the irony, but in my case I'm quoting. :)

--
Brian
follow the directions in my address to email me

Jul 20 '05 #13
Brian wrote on 31 okt 2003 in comp.infosystems.www.authoring.stylesheets:
Evertjan. wrote:
You know how to validate HTML? Hint: <http://validator.w3.org/>
Yes, if that is your definition of "invalid" then you are right.


May I ask why you put "invalid"[1] in quotes?


Yes, you may.
[1]Yes, I realize the irony, but in my case I'm quoting. :)


Same here.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #14

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

Similar topics

4
by: Turner | last post by:
Hi there, I was wondering what I should look for to make sub-menus appear at the moment you click a link or image. The menu should appear on top of the document. I'd need to know what are the...
2
by: icedgar | last post by:
am using the following script in the BeforeUpdate area of a main form. Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String strMsg = "Do you wish to save your changes?" If...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
36
by: lauren quantrell | last post by:
I'm hoping someone can tell me if there is any performance benefit in my applications between distinguishing a code routine as a Function or a Sub or if there is a performance benefit between...
3
by: Kathy Burke | last post by:
Hi, I'm tired, so this question may be silly. I have a fairly long sub procedure. Based on one condition, I load another sub with the following: If Session("GRN") = "complete" Then txtScan.Text...
2
by: Dexter | last post by:
Hello all, I have webform1, and i need to make a bow to catch all textbox in my webform1. I tray this, but don't function. Dim obj As System.Web.UI.WebControls.TextBox Dim cont As Integer For...
9
by: tshad | last post by:
I have an example I copied from "programming asp.net" (o'reilly) and can't seem to get the Sub (writefile) to execute. It displays all the response.write lines that are called directly, but not...
12
by: Gene Hubert | last post by:
How do I make a TextBox behave like the address bar in IE? That is... If focus is not on the tb, select all text if clicking on the tb or tabbing into the tb. Clicking again deselects the text...
8
by: Scott Emick | last post by:
I am using the following to compute distances between two lat/long coordinates for a store locator - (VB .NET 2003) it seems to take a long time to iterate through like 100-150 locations -...
1
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.