LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-05-2005, 11:10 AM   #1
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Rep: Reputation: 88
Numbered headings in XHTML


How can I produce automatically numbered headings using the <h1> to <h6> tags in XHTML? I have tried searching for this, but I cannot seem to find out the way to achieve this.

That is to say

Code:
1. Heading level 1
 1.1 Heading level 2
 1.2 Heading another
2. Heading another
 2.1 Another subheading
   2.1.1 Yet another subheading
I have seen this somewhere, but I forget where... Can anybody help me?
 
Old 08-05-2005, 01:19 PM   #2
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 172

Rep: Reputation: 16
I've seen this in the CSS specs:

http://www.w3.org/TR/CSS21/generate.html#counters

Is that what you're looking for?

Josh
 
Old 08-05-2005, 11:07 PM   #3
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
I tried that, but it didn't work. Maybe I'm missing something. Anybody has any examples of this?

Thanks.
 
Old 08-05-2005, 11:50 PM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 46
You're looking for an ordered list. There's a tutorial here: http://www.w3schools.com/html/html_lists.asp
Your exact answer is here: http://www.w3schools.com/html/tryit...._lists_ordered

Last edited by scuzzman; 08-05-2005 at 11:52 PM.
 
Old 08-06-2005, 01:41 AM   #5
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
scuzzman, no. I'm not looking for ordered lists. As a matter of fact, I am quite proficient in using those

In this case what I'm looking for is headline numbering. That is numbered chapters and sections using <h1> to <h6> tags to write using numbered chapters rather than un-numbered chapters.

That is I want to organize my page into chapters
Code:
1. Title of chapter 1

text goes here

1.1 Section title

text goes here

1.2. Section title

text goes here 

1.2.1 Another subsection

text goes here
That is I want numbering for my headings. Not an ordered list but for my main headings.

Hope that clarifies my question.

Last edited by vharishankar; 08-06-2005 at 01:46 AM.
 
Old 08-06-2005, 05:56 AM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,068
Blog Entries: 4

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
As requested, moved to programming
 
Old 08-07-2005, 01:12 AM   #7
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
For those interested I found that this CSS 2.1 technology (automatic numbering of heading sections) is unfortunately still poorly supported/unsupporte by most browsers other than opera.

It seems to be an older page, so I am not sure of Firefox.
Check here
http://www.markschenk.com/cssexp/pub...le.xml#support

Last edited by vharishankar; 08-07-2005 at 01:15 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An application that allows viewing e-mail headings before downloading Ariod Linux - Software 1 09-26-2005 01:16 PM
HTML to XHTML conversion rjlee Linux - Software 3 01-10-2005 07:27 AM
Can someone recommend a good JavaScript/XHTML forum? davee General 4 10-03-2003 07:34 AM
Numbered Keypad doesn't funtion. l0f33t Linux - Hardware 1 05-25-2003 11:16 AM
do you use xhtml ? linowes General 0 01-14-2003 11:01 PM


All times are GMT -5. The time now is 02:40 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration