Tuesday 6 December 2016

Chapter 3(HTML) All About Ordered List

Ordered List

In html Language we can create ordered list .
Now The Question is that What is Ordered List❓❓❔

Adding a data or creating a list of data in an ordered way is called ordered list .with the help of ordered list we can easily insert the data in list in serial order we have not worry to write like
1
2
3
It will automatically write
1
2
3
only we have to insert the values in it .
There are some features of ordered list they are given below and the program how to create ordered list in html is given below.

How to Make Ordered List In HTML

PROGRAM

<HTML>
<HEAD>
<TITLE>
WELCOME
</TITLE>
</HEAD>
<BODY>
<h1>Ordered List</h1>
<ol>
<li>MSc</li>
<li>Bachelor courses</li>
<li>MCA</li>
<li>MBA</li>
</ol>
</BODY>

</HTML>

EXPLANATION

h1 is the heading of larger size as we discussed in our previous chapter.
ol  is the declaration of the tag of ordered list.
li   is list items that we insert in ordered list.

Firstly we declare html tag ,head tag and title tag and in title tag we give a title of our choice after that we close title tag and head tag after that we start main body tag .
first we we write ordered list in h1 tag .h1 is heading tag and h1 is the larger size of heading .
after that we declare orderded list with the  tag <ol> 
After that we start inserting list items in ordered list like
<li>MSc</li>
<li>Bachelor courses</li>
<li>MCA</li>
<li>MBA</li>
 Remember when we insert one list item in ordered list after that we should also close list item tag like </li>
it means
1 MSc
2 Bachelor courses
3 MCA
like this



After inserting all the list items we close ordered list tag like </ol> and after that we close the main body tag and html tag and save the program with any name with extension.html and run it by clicking on it.

OUTPUT



FEATURES OF ORDERED LIST

The first features is that we can also write the ordered list in roman numbers .The program how to write ordered list in roman number is given below

PROGRAM

<HTML>
<HEAD>
<TITLE>
WELCOME
</TITLE>
</HEAD>
<BODY>
<ol type="I">
<li>MSc
<li>MCA
<li>MBA
</ol>
</BODY>

</HTML>                                                                                                                                                  
EXPLANATION        

The explanation for this program is same as the ordered list program given above only the difference is that in this when we declare ordered list we also declare type like  <ol type="I">  and now it will display the list items in roman numbers .

OUTPUT            


The other feature of ordered list is that we also start the list item from any number like 4,5,6 
and we can also assign a number manually to list item.

The program how to start the list item from any number and how to assign number manually to list item is given below.

PROGRAM

<HTML>
<HEAD>
<TITLE>
WELCOME
</TITLE>
</HEAD>
<BODY>
<ol type="1" start="2">
<li>MSc</li>
<li>Bachelor courses</li>
<li value="10">MCA</li>
<li>MBA</li>
</ol>
</BODY>

</HTML>

EXPLANATION

The explanation for this program is same as the ordered list program given above only the difference is that in this when we declare ordered list we also declare start means (start from value) like
<ol type="1" start="2"> 
Type means we want to see list items as 1,2,3 we can also change it to roman number and start 2 means start list item values from 2 and we can also assign a number to list item like
<li value="10">MCA</li> we have to write value in list item and in this way we can manually assign the value .

OUTPUT





If you have any query regarding this than please post a comment .



No comments:

Post a Comment