SlideShare a Scribd company logo
Page 1 of 8
Prof Mukesh N Tekwani
H T M L
Introduction:
1. HTML - Hyper Text Markup Language.
2. Developed by Tim Berners-Lee
3. Used for creating documents for World Wide Web. Documents can be
“active”, i.e., they can contain moving text, pictures, sound, movie, forms, etc.
4. Documents can be linked to other documents – hyperlinks. The various
documents may be on the same computer or on another computer in another
part of the world. A part of the document can also lead to another document.
5. HTML is used for working with non-linear information.
6. HTML documents can be viewed using a web browser such as Internet
Explorer, Netscape Navigator, Opera, etc.
Advantages of HTML:
1. HTML is easy to learn.
2. HTML document is created using a simple text editor such as Notepad. No
expensive software is required for creating or viewing HTML documents.
3. Different HTML documents can be linked whether they are on the same
computer or on different computers in other parts of the world.
4. HTML pages can be updated easily without having to change the whole
document.
5. HTML contains powerful facilities for document layout, hyper linking and
including not only text but also pictures, movies, sound, and animation.
6. HTML pages can be used to collect information by using forms.
Structure of a document:
Every HTML document has two parts: a head and a body. These two parts contain
the various tags and the text. Tags are enclosed in angular brackets < and >.
Tags:
1. A tag is a unit of markup. An HTML document is made up of text and tags.
Tags are a set of symbols which have a specific meaning in HTML.
2. Tags are enclosed between angular brackets < and >. E.g., <B>
Page 2 of 8
Prof Mukesh N Tekwani
3. Most tags are in pairs: a start tag and an end tag. E.g., <U> and </U>
4. Tags can be nested within each other. E.g., <B><I> Welcome </I></B>
5. Certain tags also have an attribute which affect the tag’s behaviour. E.g.,
<FONT COLOR = “#FF0000”>
<HTML> Tag:
Every HTML document begins with this tag and ends with the </HTML> tag.
<HEAD> Tag:
This tag appears first in an HTML document. It contains the <TITLE> tag.
The closing tag is </HEAD>.
<TITLE> Tag:
This tag is used to display text in the title bar of a window. The closing tag is
</TITLE>.
<BODY> Tag: This tag indicates the beginning of the body of an HTML document.
The closing tag is </BODY>.
To change the color of the page:
<BODY BGCOLOR = “#000000”>. This will set the page color to black.
To set the page color to yellow: <BODY BGCOLOR = “#FFFF00”>
Headings <H1> to <H6>
There are six HTML heading styles marked with the tag <H1>, <H1>, <H1>, <H1>,
<H1>, and <H6>. <H1> tag shows the heading in the largest size while <H6> shows
heading in the smallest size. A heading always starts on a new paragraph.
<P> Tag for New Paragraph
This tag is used to start a new paragraph.
<BR> Tag for New Line
This tag starts a new line within the current paragraph but does not start a new
paragraph.
Text Formatting Tags:
1. <PRE > Preformatted Text Tag
This tag is used to make your text appear the way you want it.
2. <HR > Horizontal Line Tag
This tag is used to draw a horizontal line across the screen. The attributes
are: width and size.
E. g., <HR width = 50% SIZE = 3>
Page 3 of 8
Prof Mukesh N Tekwani
This will draw a line in the center of the screen occupying 50% of screen
width, and having a line thickness of 3 pixels.
3. <OL> Ordered List Tag
An ordered list is used to indicate a sequence of events or list of items in
order.
E. g., Suppose we wish to display the following list of items in order:
1. FYJC
2. SYJC
3. FYBSc
4. SYBSc
5. TYBSc
We can create the above list as follows:
<OL>
<LI> FYJC
<LI> SYJC
<LI> FYBSC
<LI> SYBSC
<LI> TYBSC
</OL>
4. <UL> Unordered List Tag
An unordered list is used to indicate a list of items that are related to each
other but the sequence is not important. A bulleted list is created.
<UL>
<LI> Scanner
<LI> Printer
<LI> Monitor
<LI> Hard Disk
<LI> CPU
</UL>
The output is:
• Scanner
• Printer
• Monitor
• Hard Disk
• CPU
To change the bullet to a square, we can change the above code as follows:
<UL TYPE = SQUARE>
Page 4 of 8
Prof Mukesh N Tekwani
To change the bullet to a hollow circle, we can change the above code as
follows:
<UL TYPE = CIRCLE>
To change the bullet to a solid bullet, we can change the above code as
follows:
<UL TYPE = DISC>
5. <FONT> Font Tag
This tag specifies the name, size and color of the font to be used. The
FONT tag has the following attributes:
SIZE – specifies the size of the text.
FACE – Specifies the font to be used to display the text. If the specified
font is not available on the client computer, the browser substitutes a
similar font.
E.g., <FONT FACE = “Courier”> Welcome </FONT>
COLOR – Specifies the color of the text. We can specify the color code
using hexadecimal digits such as #FF0000 for Red, #00FF00 for Green,
#0000FF for Blue, etc.
These three attributes can be combined into a single statement such as:
<FONT FACE = “Courier” COLOR = “#FF8003”> Welcome </FONT>
Linking Tags:
<A > Tag Anchor
The anchor tag is used to create hyperlinks to other documents or to parts of the same
document. A hyperlink appears in a different color from the rest of the text. When the
mouse pointer is moved over a hyperlink, the pointer turns into a finger. When we
click the mouse button over a hyperlink, the browser displays another document. This
other document may be on the same computer on another computer.
To create a bookmark:
<A NAME = “Top”>Text </A>
To create a hyperlink to this bookmark:
<A HREF = “#Top”>Go Top </A>
To create a link to another document, say DOC2.HTM (assume current
document is DOC1.HTM)
<A HREF = “DOC2.HTM”> Text </A>
Page 5 of 8
Prof Mukesh N Tekwani
To create a link to a book mark another document, say DOC2.HTM (assume
current document is DOC1.HTM)
<A HREF = “DOC2.HTM#Prices”> Text </A>
Graphics in HTML Documents
Graphics are not inserted directly in an HTML document. The document contains
special tags which reference the image to be inserted by the browser when the page is
opened. The two most common types of graphics formats used for HTML documents
are JPEG (Joint Photographic Experts Group), and GIF (Graphics Interchange
Format).
To put an image in a document:
<P ALIGN = “CENTER”>
<IMG BORDER = “0” SRC = “FILE://STARS.GIF” WIDTH = “200” HEIGHT =
“165” ALT = “Stars”>
</P>
To insert an image as a background in a document:
<BODY BACKGROUND = “FILE:///Z:/SYJC/COMMON/PICTURES/MOON.JPG>
Superscript and Subscript Tags
Superscript Tag <SUP>
This tag is used to display characters in superscript mode. Characters enclosed
between the <SUP> and the </SUP> tag appear in superscript mode. E.g., to display
x2
, the HTML code is
x <SUP>2</SUP>
Subscript Tag <SUB>
This tag is used to display characters in subscript mode. Characters enclosed between
the <SUB> and the </SUB> tag appear in subscript mode. E.g., to display H2, the
HTML code is
H <SUB>2</SUB>
Tables in HTML Documents
1. Every table begins with the <TABLE> tag and ends with the </TABLE> tag.
2. The attributes of the table tag allow us to specify the following:
a. Border,
b. Distance between the cells,
c. Width and height of the table in pixels or as a percentage of the total
screen size.
3. Table rows are marked by the <TR> tag an d the end of a row is indicated by the
</TR> tag.
4. Each row’s columns are marked by the <TD> tag and the closing </TD> tag.
Page 6 of 8
Prof Mukesh N Tekwani
The following HTML code creates a table with 3 rows and 3 columns:
<TABLE>
<CAPTION>India’s Performance at the Olympics</CAPTION>
<TR>
<TD WIDTH="33%">Row 1, Col 1</TD>
<TD WIDTH="33%">Row 1, Col 2</TD>
<TD WIDTH="34%">Row 1, Col 3<TD>
</TR>
<TR>
<TD WIDTH="33%">Row 2, Col 1</TD>
<TD WIDTH="33%">Row 2, Col 2<TD>
<TD WIDTH="34%">Row 2, Col 3</TD>
</TR>
<TR>
<TD WIDTH="33%">Row 3, Col 1</TD>
<TD WIDTH="33%">Row 3, Col 2</TD>
<TD WIDTH="34%">Row 3, Col 3</TD>
</TR>
</TABLE>
To merge cells of a row:
<TR>
<TD WIDTH="33%">Data 1</TD>
<TD WIDTH="67%" COLSPAN="2">Data 2</TD>
</TR>
Example:
Write the HTML code to display the following table:
Sales by Region
REGION
YEAR
2001 2001 2003
East
West
North
South
Page 7 of 8
Prof Mukesh N Tekwani
HTML code is as follows:
<HTML>
<BODY>
<TABLE BORDER="1" WIDTH="100%">
<CAPTION>SALES BY REGION</CAPTION>
<TR>
<TD WIDTH="25%" ROWSPAN="2">REGION</TD>
<TD WIDTH="75%" COLSPAN="3">YEAR</TD>
</TR>
<TR>
<TD WIDTH="25%" ALIGN="CENTER">2001</TD>
<TD WIDTH="25%" ALIGN="CENTER">2001</TD>
<TD WIDTH="25%" ALIGN="CENTER">2003</TD>
</TR>
<TR>
<TD WIDTH="25%">
<P ALIGN="CENTER">EAST</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
</TR>
<TR>
<TD WIDTH="25%">
<P ALIGN="CENTER">WEST</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
</TR>
<TR>
<TD WIDTH="25%">
<P ALIGN="CENTER">NORTH</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
</TR>
<TR>
<TD WIDTH="25%">
Page 8 of 8
Prof Mukesh N Tekwani
<P ALIGN="CENTER">SOUTH</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
<TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD>
</TR>
</TABLE>
</BODY>
</HTML>

More Related Content

PDF
Web designing
PDF
Wp unit 1 (1)
PDF
Wp unit III
PPSX
PDF
Introduction to xml
PPTX
Xhtml
PDF
Web programming by Najeeb ullahAzad(1)
PPTX
html tutorial
Web designing
Wp unit 1 (1)
Wp unit III
Introduction to xml
Xhtml
Web programming by Najeeb ullahAzad(1)
html tutorial

What's hot (20)

PPTX
HTML 5 Topic 2
PPTX
Html Tutorial
DOCX
Html viva questions
PDF
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
PPTX
HTML5 Topic 1
DOCX
HTML (Hyper Text Markup Language) Project
PPT
Introduction to XML
PPTX
Html5
PDF
Introduction to HTML
PPTX
Lectuer html1
PPTX
HTML Introduction
PPTX
Xml in bio medical field
PPTX
Web Application and HTML Summary
PPT
uptu web technology unit 2 Xml2
PPT
Introduction to XML
PPT
Introduction to XML
HTML 5 Topic 2
Html Tutorial
Html viva questions
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
HTML5 Topic 1
HTML (Hyper Text Markup Language) Project
Introduction to XML
Html5
Introduction to HTML
Lectuer html1
HTML Introduction
Xml in bio medical field
Web Application and HTML Summary
uptu web technology unit 2 Xml2
Introduction to XML
Introduction to XML
Ad

Similar to Html tutorial (20)

PPTX
6th_sem_web_unit1_part2.pptxhshshshshshshsh
PDF
HTML-Part1
PPT
introdution-to-html.ppt
PPT
PPTX
Html
PPTX
HTML and DHTML
PPT
introdution-to-htmlppt.ppt
DOC
Html, xml and java script
PPTX
BITM3730 9-12.pptx
PDF
WEB PROGRAMMING bharathiar university bca unitII
PDF
Chapter 2 Notes, MCQs, and QA (HTML and CSS).pdf
PPT
Html ppt computer
PPT
introduction to html.ppt
PPTX
Html.ppt
PPTX
Web technologies Clent server communication
PPTX
Web_Technologies_Entire_topic_with Code.pptx
PDF
PDF
HTML.pdf
PPT
introduction-to-html hyper text markup .ppt
6th_sem_web_unit1_part2.pptxhshshshshshshsh
HTML-Part1
introdution-to-html.ppt
Html
HTML and DHTML
introdution-to-htmlppt.ppt
Html, xml and java script
BITM3730 9-12.pptx
WEB PROGRAMMING bharathiar university bca unitII
Chapter 2 Notes, MCQs, and QA (HTML and CSS).pdf
Html ppt computer
introduction to html.ppt
Html.ppt
Web technologies Clent server communication
Web_Technologies_Entire_topic_with Code.pptx
HTML.pdf
introduction-to-html hyper text markup .ppt
Ad

More from Mukesh Tekwani (20)

PDF
The Elphinstonian 1988-College Building Centenary Number (2).pdf
PPSX
Circular motion
PPSX
Gravitation
PDF
ISCE-Class 12-Question Bank - Electrostatics - Physics
PPTX
Hexadecimal to binary conversion
PPTX
Hexadecimal to decimal conversion
PPTX
Hexadecimal to octal conversion
PPTX
Gray code to binary conversion
PPTX
What is Gray Code?
PPSX
Decimal to Binary conversion
PDF
Video Lectures for IGCSE Physics 2020-21
PDF
Refraction and dispersion of light through a prism
PDF
Refraction of light at a plane surface
PDF
Spherical mirrors
PDF
Atom, origin of spectra Bohr's theory of hydrogen atom
PDF
Refraction of light at spherical surfaces of lenses
PDF
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
PPSX
Cyber Laws
PPSX
Social media
The Elphinstonian 1988-College Building Centenary Number (2).pdf
Circular motion
Gravitation
ISCE-Class 12-Question Bank - Electrostatics - Physics
Hexadecimal to binary conversion
Hexadecimal to decimal conversion
Hexadecimal to octal conversion
Gray code to binary conversion
What is Gray Code?
Decimal to Binary conversion
Video Lectures for IGCSE Physics 2020-21
Refraction and dispersion of light through a prism
Refraction of light at a plane surface
Spherical mirrors
Atom, origin of spectra Bohr's theory of hydrogen atom
Refraction of light at spherical surfaces of lenses
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
Cyber Laws
Social media

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Big Data Technologies - Introduction.pptx
Encapsulation theory and applications.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf

Html tutorial

  • 1. Page 1 of 8 Prof Mukesh N Tekwani H T M L Introduction: 1. HTML - Hyper Text Markup Language. 2. Developed by Tim Berners-Lee 3. Used for creating documents for World Wide Web. Documents can be “active”, i.e., they can contain moving text, pictures, sound, movie, forms, etc. 4. Documents can be linked to other documents – hyperlinks. The various documents may be on the same computer or on another computer in another part of the world. A part of the document can also lead to another document. 5. HTML is used for working with non-linear information. 6. HTML documents can be viewed using a web browser such as Internet Explorer, Netscape Navigator, Opera, etc. Advantages of HTML: 1. HTML is easy to learn. 2. HTML document is created using a simple text editor such as Notepad. No expensive software is required for creating or viewing HTML documents. 3. Different HTML documents can be linked whether they are on the same computer or on different computers in other parts of the world. 4. HTML pages can be updated easily without having to change the whole document. 5. HTML contains powerful facilities for document layout, hyper linking and including not only text but also pictures, movies, sound, and animation. 6. HTML pages can be used to collect information by using forms. Structure of a document: Every HTML document has two parts: a head and a body. These two parts contain the various tags and the text. Tags are enclosed in angular brackets < and >. Tags: 1. A tag is a unit of markup. An HTML document is made up of text and tags. Tags are a set of symbols which have a specific meaning in HTML. 2. Tags are enclosed between angular brackets < and >. E.g., <B>
  • 2. Page 2 of 8 Prof Mukesh N Tekwani 3. Most tags are in pairs: a start tag and an end tag. E.g., <U> and </U> 4. Tags can be nested within each other. E.g., <B><I> Welcome </I></B> 5. Certain tags also have an attribute which affect the tag’s behaviour. E.g., <FONT COLOR = “#FF0000”> <HTML> Tag: Every HTML document begins with this tag and ends with the </HTML> tag. <HEAD> Tag: This tag appears first in an HTML document. It contains the <TITLE> tag. The closing tag is </HEAD>. <TITLE> Tag: This tag is used to display text in the title bar of a window. The closing tag is </TITLE>. <BODY> Tag: This tag indicates the beginning of the body of an HTML document. The closing tag is </BODY>. To change the color of the page: <BODY BGCOLOR = “#000000”>. This will set the page color to black. To set the page color to yellow: <BODY BGCOLOR = “#FFFF00”> Headings <H1> to <H6> There are six HTML heading styles marked with the tag <H1>, <H1>, <H1>, <H1>, <H1>, and <H6>. <H1> tag shows the heading in the largest size while <H6> shows heading in the smallest size. A heading always starts on a new paragraph. <P> Tag for New Paragraph This tag is used to start a new paragraph. <BR> Tag for New Line This tag starts a new line within the current paragraph but does not start a new paragraph. Text Formatting Tags: 1. <PRE > Preformatted Text Tag This tag is used to make your text appear the way you want it. 2. <HR > Horizontal Line Tag This tag is used to draw a horizontal line across the screen. The attributes are: width and size. E. g., <HR width = 50% SIZE = 3>
  • 3. Page 3 of 8 Prof Mukesh N Tekwani This will draw a line in the center of the screen occupying 50% of screen width, and having a line thickness of 3 pixels. 3. <OL> Ordered List Tag An ordered list is used to indicate a sequence of events or list of items in order. E. g., Suppose we wish to display the following list of items in order: 1. FYJC 2. SYJC 3. FYBSc 4. SYBSc 5. TYBSc We can create the above list as follows: <OL> <LI> FYJC <LI> SYJC <LI> FYBSC <LI> SYBSC <LI> TYBSC </OL> 4. <UL> Unordered List Tag An unordered list is used to indicate a list of items that are related to each other but the sequence is not important. A bulleted list is created. <UL> <LI> Scanner <LI> Printer <LI> Monitor <LI> Hard Disk <LI> CPU </UL> The output is: • Scanner • Printer • Monitor • Hard Disk • CPU To change the bullet to a square, we can change the above code as follows: <UL TYPE = SQUARE>
  • 4. Page 4 of 8 Prof Mukesh N Tekwani To change the bullet to a hollow circle, we can change the above code as follows: <UL TYPE = CIRCLE> To change the bullet to a solid bullet, we can change the above code as follows: <UL TYPE = DISC> 5. <FONT> Font Tag This tag specifies the name, size and color of the font to be used. The FONT tag has the following attributes: SIZE – specifies the size of the text. FACE – Specifies the font to be used to display the text. If the specified font is not available on the client computer, the browser substitutes a similar font. E.g., <FONT FACE = “Courier”> Welcome </FONT> COLOR – Specifies the color of the text. We can specify the color code using hexadecimal digits such as #FF0000 for Red, #00FF00 for Green, #0000FF for Blue, etc. These three attributes can be combined into a single statement such as: <FONT FACE = “Courier” COLOR = “#FF8003”> Welcome </FONT> Linking Tags: <A > Tag Anchor The anchor tag is used to create hyperlinks to other documents or to parts of the same document. A hyperlink appears in a different color from the rest of the text. When the mouse pointer is moved over a hyperlink, the pointer turns into a finger. When we click the mouse button over a hyperlink, the browser displays another document. This other document may be on the same computer on another computer. To create a bookmark: <A NAME = “Top”>Text </A> To create a hyperlink to this bookmark: <A HREF = “#Top”>Go Top </A> To create a link to another document, say DOC2.HTM (assume current document is DOC1.HTM) <A HREF = “DOC2.HTM”> Text </A>
  • 5. Page 5 of 8 Prof Mukesh N Tekwani To create a link to a book mark another document, say DOC2.HTM (assume current document is DOC1.HTM) <A HREF = “DOC2.HTM#Prices”> Text </A> Graphics in HTML Documents Graphics are not inserted directly in an HTML document. The document contains special tags which reference the image to be inserted by the browser when the page is opened. The two most common types of graphics formats used for HTML documents are JPEG (Joint Photographic Experts Group), and GIF (Graphics Interchange Format). To put an image in a document: <P ALIGN = “CENTER”> <IMG BORDER = “0” SRC = “FILE://STARS.GIF” WIDTH = “200” HEIGHT = “165” ALT = “Stars”> </P> To insert an image as a background in a document: <BODY BACKGROUND = “FILE:///Z:/SYJC/COMMON/PICTURES/MOON.JPG> Superscript and Subscript Tags Superscript Tag <SUP> This tag is used to display characters in superscript mode. Characters enclosed between the <SUP> and the </SUP> tag appear in superscript mode. E.g., to display x2 , the HTML code is x <SUP>2</SUP> Subscript Tag <SUB> This tag is used to display characters in subscript mode. Characters enclosed between the <SUB> and the </SUB> tag appear in subscript mode. E.g., to display H2, the HTML code is H <SUB>2</SUB> Tables in HTML Documents 1. Every table begins with the <TABLE> tag and ends with the </TABLE> tag. 2. The attributes of the table tag allow us to specify the following: a. Border, b. Distance between the cells, c. Width and height of the table in pixels or as a percentage of the total screen size. 3. Table rows are marked by the <TR> tag an d the end of a row is indicated by the </TR> tag. 4. Each row’s columns are marked by the <TD> tag and the closing </TD> tag.
  • 6. Page 6 of 8 Prof Mukesh N Tekwani The following HTML code creates a table with 3 rows and 3 columns: <TABLE> <CAPTION>India’s Performance at the Olympics</CAPTION> <TR> <TD WIDTH="33%">Row 1, Col 1</TD> <TD WIDTH="33%">Row 1, Col 2</TD> <TD WIDTH="34%">Row 1, Col 3<TD> </TR> <TR> <TD WIDTH="33%">Row 2, Col 1</TD> <TD WIDTH="33%">Row 2, Col 2<TD> <TD WIDTH="34%">Row 2, Col 3</TD> </TR> <TR> <TD WIDTH="33%">Row 3, Col 1</TD> <TD WIDTH="33%">Row 3, Col 2</TD> <TD WIDTH="34%">Row 3, Col 3</TD> </TR> </TABLE> To merge cells of a row: <TR> <TD WIDTH="33%">Data 1</TD> <TD WIDTH="67%" COLSPAN="2">Data 2</TD> </TR> Example: Write the HTML code to display the following table: Sales by Region REGION YEAR 2001 2001 2003 East West North South
  • 7. Page 7 of 8 Prof Mukesh N Tekwani HTML code is as follows: <HTML> <BODY> <TABLE BORDER="1" WIDTH="100%"> <CAPTION>SALES BY REGION</CAPTION> <TR> <TD WIDTH="25%" ROWSPAN="2">REGION</TD> <TD WIDTH="75%" COLSPAN="3">YEAR</TD> </TR> <TR> <TD WIDTH="25%" ALIGN="CENTER">2001</TD> <TD WIDTH="25%" ALIGN="CENTER">2001</TD> <TD WIDTH="25%" ALIGN="CENTER">2003</TD> </TR> <TR> <TD WIDTH="25%"> <P ALIGN="CENTER">EAST</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> </TR> <TR> <TD WIDTH="25%"> <P ALIGN="CENTER">WEST</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> </TR> <TR> <TD WIDTH="25%"> <P ALIGN="CENTER">NORTH</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> </TR> <TR> <TD WIDTH="25%">
  • 8. Page 8 of 8 Prof Mukesh N Tekwani <P ALIGN="CENTER">SOUTH</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> <TD WIDTH="25%" ALIGN="CENTER">&NBSP;</TD> </TR> </TABLE> </BODY> </HTML>