Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Automatic numbering of headers

Reply
Thread Tools

Automatic numbering of headers

 
 
Daan
Guest
Posts: n/a
 
      07-04-2003
Say I have the following document structure:

<h1>First Part</h1>
<h2>First chapter in first part</h2>
<h2>Second chapter</h2>
<h1>Second Part</h1>
<h2>First chapter in second part</h2>
<h3>Paragraph X</h3>
<h3>Paragraph Y</h3>
<h3>Paragraph Z</h3>
<h2>Second chapter</h2>

Is it possible, perhaps using CSS, to automatically append numbering
to these heads, such that the result is:

1 First Part
1.1 First chapter in first part
1.2 Second chapter
2 Second Part
2.1 First chapter in second part
2.1.1 Paragraph X
2.1.2 Paragraph Y
2.1.3 Paragraph Z
2.2 Second chapter

It's not that I really want to apply this on a website, but I am
curious if it is possible with HTML / CSS.

Daan


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      07-04-2003
Daan wrote:

> Is it possible, perhaps using CSS, to automatically append numbering
> to these heads, such that the result is:
>
> 1 First Part
> 1.1 First chapter in first part
> 1.2 Second chapter


> It's not that I really want to apply this on a website, but I am
> curious if it is possible with HTML / CSS.


Possible, but very very very badly supported (Mozilla and IE don't support
it, I haven't tested with Opera or Safari).

http://www.w3.org/TR/CSS2/syndata.html#counter

--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
 
Reply With Quote
 
 
 
 
Jacqui or (maybe) Pete
Guest
Posts: n/a
 
      07-04-2003
In article <be3m7e$8qp$1$(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed)
says...
> Daan wrote:
>
> > Is it possible, perhaps using CSS, to automatically append numbering
> > to these heads, such that the result is:
> >
> > 1 First Part
> > 1.1 First chapter in first part
> > 1.2 Second chapter

>
> > It's not that I really want to apply this on a website, but I am
> > curious if it is possible with HTML / CSS.

>
> Possible, but very very very badly supported (Mozilla and IE don't support
> it, I haven't tested with Opera or Safari).
>
> http://www.w3.org/TR/CSS2/syndata.html#counter
>

Opera's pretty good. Mozilla seems unlikely ever to support them (so
much for standards compliance):

http://bugzilla.mozilla.org/show_bug.cgi?id=3247

Fairly simple example: http://porjes.com/revlist.html

 
Reply With Quote
 
Daan
Guest
Posts: n/a
 
      07-04-2003
> > Is it possible, perhaps using CSS, to automatically append
numbering
> > to these heads, such that the result is:
> >
> > 1 First Part
> > 1.1 First chapter in first part
> > 1.2 Second chapter

>
> > It's not that I really want to apply this on a website, but I am
> > curious if it is possible with HTML / CSS.

>
> Possible, but very very very badly supported (Mozilla and IE don't

support
> it, I haven't tested with Opera or Safari).
>
> http://www.w3.org/TR/CSS2/syndata.html#counter


Hm, it looks like Opera 7 has some sort of an implementation for it,
but I can't really get it to work like I wanted to. Not that it really
matters, I can just use Word of Latex to get the effect, but I was
just curious.

Daan


 
Reply With Quote
 
Chris Harris
Guest
Posts: n/a
 
      07-04-2003
>
> 1 First Part
> 1.1 First chapter in first part
> 1.2 Second chapter
> 2 Second Part
> 2.1 First chapter in second part
> 2.1.1 Paragraph X
> 2.1.2 Paragraph Y
> 2.1.3 Paragraph Z
> 2.2 Second chapter
>
> It's not that I really want to apply this on a website, but I am
> curious if it is possible with HTML / CSS.


Ordered lists should do it


 
Reply With Quote
 
Lauri Raittila
Guest
Posts: n/a
 
      07-07-2003
In article <be3muj$b3i$(E-Mail Removed)>, "Daan" <daanstolp @
newmail . net> wrote:
> > > Is it possible, perhaps using CSS, to automatically append

> numbering
> > > to these heads, such that the result is:
> > >
> > > 1 First Part
> > > 1.1 First chapter in first part
> > > 1.2 Second chapter

> > http://www.w3.org/TR/CSS2/syndata.html#counter

>
> Hm, it looks like Opera 7 has some sort of an implementation for it,
> but I can't really get it to work like I wanted to.


Some of Opera 7.x have broken support for counters, 7.2b1 seems to handle
them correctly. Opera versions 5 and 6 are also fine.

In action:
http://www.student.oulu.fi/~laurirai...alifornia.html
(250kB+ of Finnish text and images)
http://www.student.oulu.fi/~laurirai...kalifornia.css

The index have generated numbers, the rest doesn't.

Should degrade nicely, but haven't tested troughly.

--
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with wsgiref.headers.Headers Phil Python 4 01-17-2010 04:47 PM
Server cannot clear headers after HTTP headers have been sent Ian ASP .Net Security 2 03-20-2007 09:00 AM
DOCBOOK/XSLT - Suppressing the automatic numbering Michael Doubez XML 1 01-27-2007 03:57 PM
Automatic detection of "dead" headers? Donovan Martin C++ 3 10-06-2004 07:29 PM
Reading 'received' headers: Email Headers Parsing dont bother Python 0 03-03-2004 08:18 PM



Advertisments