g8 HTML Lesson 3 HTML q4
g8 HTML Lesson 3 HTML q4
AND TABLES
OBJECTIVES
• Know the different list and table tags.
<tagName>
Example: <BR>
Single Tags with Attributes
<tagName attributes>
<UL> • SimCity
<LI>SimCity</LI> • Quake
<LI>Quake</LI> • Bridge
<LI>Bridge</LI>
</UL>
<UL> Un-ordered List
disc – solid-shaded
Deprecated. Use styles bullets
instead.
circle – circular/hole
type Specifies the style of the
bullets
bullet points of the list
items square – dark square
bullets
• Ordered Lists
• Definition List
Ordered List
is equivalent to the
numbering feature
of MS Office.
<OL> 1. SimCity
<LI>SimCity</LI> 2. Quake
<LI>Quake</LI> 3. Bridge
<LI>Bridge</LI>
</OL> Numbers
instead of discs,
circles or
squares
Ordered List Browser Display
25. SimCity
26. Quake
27. Bridge
Ordered List Browser Display
It is a list of items
with a description
of each item
(term).
Definition List Browser Display
<DL> SimCity Term
<DT>SimCity</DT>
A great simulation
<DD>A great
simulation game in game in which one
which one build build cities
cities </DD> Quake
<DT>Quake</DT> Definition
<DD> One of the One of the best of
best of the shoot- the shoot-em-up
em-up genre genre
</DD>
</DL>
<DL> Definition List
<DT> Term
<DD> Definition
Table Tags
The TABLE element characterizes a grid for
multi-dimensional data arranged in rows and
columns.
Table Tags
Table
<TABLE>
(made up of rows)
Row
<TR>
(made up of data cells)
Heading Data Cell
<TH> (Can contain paragraphs,
images, lists, forms, tables)
Data Cell
<TD> (Can contain paragraphs,
images, lists, forms, tables)
HTML Code Browser Display
• CELLPADING
– Determines the distance between the border of a cell and
the contents of the cell
– Example: <TABLE CELLPADDING = “3”>
• CELLSPACING
– Determines the empty spacing between the borders of two
adjacent cells
– Example: <TABLE CELLSPACING = “1”>
HTML Code Browser Display
<TABLE> Outdoo
Indoor
<TR> r
<TH>Indoor</TH> Squash Cricket
<TH>Outdoor</TH>
</TR>
<TR>
<TD>Squash</TD>
<TD>Cricket</TD>
</TR>
</TABLE>
<TABLE>,<TR>,<TH>,<TD> Attributes
• ALIGN
– Possible values: Center, Left, Right
– Example: <TH ALIGN = “center”>
50% of
• BGCOLOR the
– Example: <TD BGCOLOR = “red”> screen
width
• WIDTH
– Example: <TR WIDTH = “40%”>
• HEIGHT
– Example: <TABLE HEIGHT = “200”>
<TR> Attributes
• VLAIGN
– Determines the vertical alignment of the
contents of all of the cells in a particular row
– Possible values: Top, Middle, Bottom
– Example: <TR VALIGN = “bottom”>
<TH> & <TD> Attributes
• NOWRAP
– Extend the width of a cell, if necessary, to fit the contents of
the cell in a single line
– Example: <TD NOWRAP>
• COLSPAN
– No. of rows the current cell should extend itself downward
– Example: <TD COLSPAN = “2”>
• ROWSPAN
– The number of columns the current cell should extend itself
– Example: <TD ROWSPAN = “5”>
• VALIGN
– Same as that for <TR>
HTML Code Browser Display
<TABLE border=“1” >
<TR>
Indoor Outdoor
<TH colspan=“2”> Squash Cricket
Indoor Outdoor
</TH>
</TR>
<TR>
<TD>Squash</TD>
<TD>Cricket</TD>
</TR>
</TABLE>
Caption Tag
• The caption element is an optional table
component which displays a caption/title for the
table directly above, below or to either side of
the table. The caption element is contained
within the TABLE element, but is used at the
same level as the table row element [TR] is.
HTML Code Browser Display