Documente Academic
Documente Profesional
Documente Cultură
Unit II
KEYWORD
S
Tables
Table Data
Tags
Table Header
Tables consist of columns and rows. You can create tables in your webpage
when you want to display your data in row and column form. To create a table in
HTML, we use the <TABLE> </TABLE> tags. There are also Sub-element tags that
can be used for setting the Table Alignment.
Below are the tags that allow you to control on how text and images are
aligned without having to deal with the frustrating general tags that cannot place an
element, the way you prefer an image to appear. Sub-elements of Table are shown
below.
Tags
Description
<TR>
<TH>
<TD>
<CAPTION>
Values
#pixels
Description
cell spacing represents the space
between cells and is specified by
CELLSPACING
#pixels
pixels
cell padding represents the space
between the cell border and the
cell contents and is specified in
BGCOLOR
#RRGGBB
pixels
background color specifies the
BACKGROUND
Or Color Name
image file name
ALIGN
(Left/Center/Right
)
loaded as background.
alignment Specifies how text within
the cell will line up.
WIDTH
#pixels or % of
document
#pixels
%.
border Define the line that form the
BORDERCOLOR
#RRGGBB
BORDERCOLORLIGH
Or Color Name
#RRGGBB
T
BORDERCOLORDAR
Or Color Name
#RRGGBB
form 3D bordersaroundthecell.
border color dark - Dark color used to
Or Color Name
BORDER
Below is the Program output of the HTML Program 2. The output shows
the uses of the attributes Cellspacing, Cellpadding, BGColor, Background, etc.
Program Output 2
ALIGN which can be TOP or BOTTOM. Below is an HTML Program that uses
Table caption.
HTML Program 3
Values
#pixels or %
Description
Height specifies the height in pixels or % of
#pixels or %
COLSPAN
ROWSPAN
CHAR
ALIGN
#pixels
#pixels
Character
VALIGN
Justify/Char)
(Top/Middle/Botto
BACKGROUN
m)
Image file name
BGCOLOR
#RRGGBB
Or Color Name
background.
background color specifies the background
color of a specific cell
Frames
Frames are used to display multiple HTML files. They act dynamic unlike in
table it is static. Website visitors find it appealing when the choices of information
are not pressed to one side of the page. Frames are well used when the main topics
are hyperlinked and placed at the left of the page. And all the content belonging to
a particular topic is placed at the right side of the page. Commonly, the left side
occupies only 20% of the page while the right side of the page takes the rest.
KEYPOINTS
Tables consist of columns and rows. You can create tables in your webpage
when you want to display your data in row and column form.
Frames are well-used when the main topics are hyperlinked and place at
the left of the page.
HANDS-ON ACTIVITY:
ACTIVITY 1:
Create a program that will display a table containing 10 Asian countries,
their currency, and current president. The requirement is as follows:
Column for Countries = Green
Column for Currencies = Gray
Column for Presidents = Red
ACTIVITY 2:
Create a program that will display three frames from the three countries
enumerated in Activity 1. Include corresponding description to the said
countries.