Ordered List

Ordered List in HTML <OL>


Ordered list also called as Numbered list, is used to present a numbered list of item in the order of importance or the item (paragraph) is marked with a number.

An ordered list must begin with the <OL> followed by an <LI> list item tag.

Example: An HTML document orderedList.html shows the use of Ordered List

<HTML>
<HEAD>
<TITLE>
An Ordered List
</TITLE>
</HEAD>
<BODY>
<H1><U> Various Terms Used In Internet</U></H1>
<OL>
<LI> WWW-World Wide Web
<LI> URL-Uniform Resource Locator
<LI> HTTP-Hypertext Transfer Protocol
<LI> FTP-File Transfer Protocol
<LI> HTML-Hypertext Markup Language
</OL>
</BODY>
</HTML>


Attributes of <OL> tag:

COMPACT : render a list in compact form.

TYPE : allows marking list items with different types. By default the list Item markers are set to numbers 1,2,3… so on.

Other values of TYPE attribute are:


Attribute
Description
Type = A
Capital letter eg. A, B, C………
Type = a
Small letter eg. a, b, c,………
Type = I
Uppercase Roman Numbers eg. I, II, III……
Type = i
Lowercase Roman Numbers eg. i, ii, iii……
Type = 1
eg. 1, 2, 3………….

START : used for lists that need to start at values other than 1. START always specified in default numbers, and is completed based on TYPE before display, For example, If START =5 it would display either an ‘E’, ‘e’, ‘V’, ‘v’, or ‘5’ based an TYPE attribute.






Example Programs



Program [1]

<!doctype html>
<html>
<head>
<title>HTML Assignment 4</title>
</head>
<body topmargin="50px" leftmargin="200px">
<center>
<u>
<h4>List of Courses</h4>
</u>
</center>
<h4>Certificate Courses</h4>
<ul type="square">
<li>CCA</li>
<li>DTP</li>
<li>TALLY</li>
</ul>
<h4>NIELIT Courses</h4>
<ol type="I">
<li>CCC</li>
<li>O Level</li>
<li>A Level</li>
</ol>
<h4>Diploma Courses</h4>
<ol type="A">
<li>DCA</li>
<li>ADCA</li>
<li>DFA</li>
<li>DDNT</li>
</ol>
<h4>Programming Courses</h4>
<ol start="11">
<li>PYTHON</li>
<li>Java</li>
<li>C Programming</li>
<li>C++</li>
<li>Data Structure using C</li>
</ol>
<h4>Web Designing Courses</h4>
<ol>
<li>HTML</li>
<li>CSS</li>
<li>Bootstrap</li>
<li value="11">Java Script</li>
<li>JQuery</li>
<li value="21">MySQL</li>
<li>PHP</li>
</ol>
</body>
</html>

View Solution

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Website development Company in Allahabad Sarkari Exam Quiz